Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

In the counting example on page 5, what is the final value of count that causes the loop condition (count <= 5) to become False and terminate the loop?
Options
A 1
B 5
C 6
Correct Answer
D 0
Correct Answer

Option C is the correct answer.

Detailed Explanation

The loop executes for count values 1, 2, 3, 4, and 5. After printing 5, count is updated to 6. When the loop checks 6 <= 5, the condition is False, and the loop terminates. Thus, the value of count that causes termination is 6.

Hint

The slide explicitly mentions '...and so on until count is 6.' to indicate the termination point.

Question Info