Ch. 5.6: The for Loop Flashcards
What is a conditional loop?
A loop that will execute as long as the input value is invalid.
What is a count-controlled loop?
A loop where you know the exact number of iterations that a loop must perform.
What is the for loop?
The for loop is specifically designed to initialize, test, and update a counter variable.
What is the initialization expression?
It is normally used to initialize a counter variable to its starting value.
What is the test expression?
This is an expression that controls the execution of the loop. As long as this expression is true the body of the for loop will repeat.
What is the update expression?
It executes at the end of each iteration. Typically, this is a statement that increments the loop’s counter variable.