The general form of the "For loop" statement is
for(exp1;exp2;exp3)
{
The body of loop (block of statements)
}
It is executed as follow :
for(exp1;exp2;exp3)
{
The body of loop (block of statements)
}
It is executed as follow :
- Exp1 is evaluated.
- Exp2 is evaluated.If it is true (non zero), the body of the for loop is executed, followed by exp3 and this step(2) is repeated. If exp2 is false (zero), the loop terminates and the execution continues with the next statements if any after the for loop.
No comments:
Post a Comment