Which statement immediately terminates the innermost enclosing loop or switch in C?
Correct answer
D. break, which transfers control after the construct
13 views
D. break, which transfers control after the construct
13 views
The break statement exits the nearest loop or switch immediately and resumes execution at the first statement after it. continue is different: it skips the rest of the current iteration but keeps looping. return leaves the entire function and hands a value back to the caller, so it is not a loop-control statement at all.
Asked in: NTS, PPSC IT, Campus Interviews
Not sure why the answer is D? Ask here and get an explanation.