Answer:
The answer to this question is given below in the explanation section
Explanation:
The for-loop is used in all programming languages to iterate a number of statement to a specific number or to a specific condition.
The syntax of for-loop is given below:
for (initialization; condition; update) {
// body of-loop
}
Initialization initializes variables and executed only once. This shows that from where the for-loop will begin.
Condition parts represent the loop-condition, if true the body of for-loop gets executed.
Update-updates the value of initialized variables and again checks the condition. It will increment/decrement the intialized variable.
For example: the for-loop that count total achieved numbers of 5 subjects of a student
for (int subject =1, subject>=5, subject++)
{
//count number of each subject
// count total.
}