The break statement inside a loop causes control to:
-
A
exit the innermost loop or switch immediately
Correct answer
-
B
skip only the current iteration of the loop
-
C
restart the loop from its very beginning
-
D
terminate the whole program at once
Correct answer
A. exit the innermost loop or switch immediately
13 views
Explanation
break exits the nearest enclosing loop or switch, whereas continue skips the rest of the current iteration.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ