Date post: | 17-Jan-2018 |
Category: |
Documents |
Upload: | emma-rodgers |
View: | 220 times |
Download: | 0 times |
If you can't read please download the document
1 For Loops l From Chapter 9 l A shorthand way of coding count loops 2 A For Loop is a Count-Controlled Loop SYNTAX for ( initialization ; test expression ; update ) { 0 or more statements to repeat } 3 The for loop contains an initialization of a count variable an expression to test the count variable for continuing an update to the count variable after each iteration of the body 4 Example of Repetition int num; for ( num = 1 ; num