Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

When a break statement is executed inside a while loop, what happens immediately?
Options
A The program pauses for user input.
B The loop condition is re-evaluated.
C The loop terminates, and execution continues with the statement immediately following the loop.
Correct Answer
D The program skips to the next iteration of the loop.
Correct Answer

Option C is the correct answer.

Detailed Explanation

The 'The 'break' Statement' slide (page 9) describes break as exiting a loop instantly. This means the loop stops, and the program flow immediately moves to whatever code comes after the loop, without re-evaluating the loop's condition or executing further loop body statements.

Hint

Think about the core purpose of an 'emergency exit' from a loop.

Question Info