Multiple choice technology programming languages

Break statement cannot be used in a

  1. For loop

  2. While loop

  3. if loop

  4. All the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The break statement is used to exit from loops (for, while, do-while) and switch statements. It cannot be used with if statements because if is a conditional statement, not a loop. 'if loop' is incorrect terminology but the meaning is clear.