This preview shows page 1. Sign up to view the full content.
Unformatted text preview: tests the expression count <= limit and executes the loop body as long as the expression is true. The last statement in the loop increments the loop control variable count . How many times does the loop execute? The loop executes when count is 1, 2, 3, . .. limit . So the loop executes limit times. The initial value of the loop control variable and the relational operator used in the Boolean expression determine the number of times the loop executes. Set count to 1 Initialize count to 1 While (count <= limit) Test ... Body of the loop Set count to count + 1 Increment ... Statement(s) following loop...
View Full Document
This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.
- Fall '10