Electrical and Computer Engineering
9 of 23
UAH
CPE 112
Count-Controlled Loops
•A loop control variable is used – it must be initialized before it is tested and it must be updated in the body of the loop.
•Example:
–loopCount = 1;
–while (loopCount <= 10)
–{
•.
•.
•.
•loopCount = loopCount + 1;
–}
–loop exit