for Statement: Notes and Observations
The initialization, loop-continuation condition and increment expressions of a
for statement can contain arithmetic expressions. For example, if
x = 2 and
y = 10, and
y are not modified in the loop body, the
for ( unsigned int j = x; j <= 4 * x * y; j += y / x )
is equivalent to
for ( unsigned int j = 2; j <= 80; j += 5 )
The “increment” of a
for statement can be negative, in which case it’s really a decrement and the loop actually counts downward (as shown in Section 5.4).
If the loop-continuation condition is initially false, the body of the
for statement is not performed. Instead, execution proceeds with the statement following the
Frequently, the control variable is printed or ...