Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

What is the primary function of the break statement in a loop?
Options
A To skip the current iteration and continue with the next one.
B To pause the execution of the program for a specified time.
C To exit the loop instantly, even if the condition is still True.
Correct Answer
D To restart the loop from the beginning.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Slide 9, 'The 'break' Statement', explains: 'Sometimes you need to exit a loop instantly, even if the condition is still True.'

Hint

Consider the meaning of 'instantly exiting' a loop.

Question Info