|
Try entering an initial value of 9 and a limit value of 4. What happens? Why? A good answer might be:
The loop does not execute, even once.
This is because the condition of the while statement, |
Loop Control Variable
All the
The variable count is the one that is initialized, tested, and
changed as the loop executes.
It is an ordinary int variable, but it is used in a special role.
The role is that of a loop control variable.
Not all loops have loop control variables, however.
The type of loop we have been looking at is a counting loop,
since it counts upwards using the loop control variable as a counter.
You can make counting loops with statements other than the while
statement, and not all |
QUESTION 11:Do you think that a counting loop will always count upwards by ones? Click Here after you have answered the question |