10 The while Loop

Chapter 11
The
for Loop
The for loop enables you to repeat sections of your program for a specific number of times. Unlike the while and do-while loops, the for loop is a determinate loop. This means when you write your program you can usually determine how many times the loop takes place. The while and do-while loops continue only until a condition is met. The for loop does this and more: It continues looping until a count (or countdown) is reached. After the final for loop count is reached, execution continues with the next statement, in sequence.
This chapter teaches you the following topics:
The for statement
How for statements terminate
Benefits of nested for loops

 



C by Example
C by Example
ISBN: 0789722399
EAN: 2147483647
Year: 1999
Pages: 43
Authors: Greg Perry

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net