The C for statement has the following form:
expression initialises; expression
is the terminate test;
expression
is the modifier (which may be more than just
simple increment);
NOTE: C basically treats for statements as while type loops
For example:
...outputs:
...to the screen
All the following are legal for statements in C. The practical application of such statements is not important here, we are just trying to illustrate peculiar features of C for that may be useful:-
The second example shows that multiple expressions can be separated a ,.
In the third example the loop will continue to iterate until z becomes 0;