3.2.2 for |
for ( InitLoop; EndLoopCondition; IncrementLoopStatement )For example:
StatementToExecute
int loop; //declare integer loop int y=0; //declare integer y initialized to 0 for (loop=0; loop < 10; loop++) //increment loop from 0 to 9 y= y+ loop*2; // set y equal to y plus loop times 2