chap 4 Flashcards
1
Q
the ____ loop allows the user to decide on the number of iterations
A
user controlled loop
2
Q
A count-controlled for loop must have what three elements
A
- It must initialize a control variable to a starting value
- It must test the control variable by comparing it to a maximum value. When the control variable reaches its maximum value, the loop terminates
- it must update the control variable during each iteration. This is usually done by incrementing the variable.