
332 CHAPTER 6 Flow of Control,Part 2: Looping
Figure 6.19
Flow of Control of the for
Loop
16677_05_0083A
condition?
false
true
initialization
loop body
loop update
process results
however. Because all the loop control is contained in the for loop header,
you can easily see what condition will stop the loop and how the condition
will be updated after each iteration.
6.10.2 Constructing for Loops
Typically, we use a loop control variable in a for loop; that control variable
is usually used for counting. We set its initial value in the initialization
statement, increment or decrement its value in the loop update statement,
and check its value in the loop condition. ...