Question Detail

COS 102 6 lecture note; fundamentals of programming Objective Question

Question

What is the effect of the break statement in a loop?
Options
A It skips the current iteration and moves to the next.
B It terminates the execution of the loop unconditionally.
Correct Answer
C It pauses the loop for a specified duration.
D It restarts the loop from the beginning.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Slide 94 states: 'Break can be used to unconditionally jump out of the loop. It terminates the execution of the loop.'

Hint

Check the definition and behavior of the 'break STATEMENT' on slide 94.

Question Info