Break statement is used to terminate _____ loop(s).
-
for
-
while
-
do-while
-
all of the above
D
Correct answer
Explanation
The break statement immediately terminates the nearest enclosing loop or switch statement. It works with all loop types - for, while, and do-while - as well as switch statements, transferring control to the statement following the loop/switch.