1 for loops l from chapter 9 l a shorthand way of coding count loops

Download 1 For Loops l From Chapter 9 l A shorthand way of coding count loops

If you can't read please download the document

Upload: emma-rodgers

Post on 17-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

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

TRANSCRIPT

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