Question Detail
Question
In the counting example from Slide 5, what is the value of the
count variable immediately *after* the loop has finished executing?
Correct Answer
Option C is the correct answer.
Detailed Explanation
The loop continues as long as
count is 5 or less. After printing 5, count becomes 6. At this point, 6 ≤ 5 is False, and the loop terminates. So, count is 6 after the loop.
Hint
The loop condition is checked *before* each iteration. When does the condition become false?