1. Home
  2. Computer Science MCQs
  3. C Programming
  4. Which statement immediately terminates the innermost…

Added 30 Nov -0001

Which statement immediately terminates the innermost enclosing loop or switch in C?

  1. continue, which jumps ahead to the next iteration of the loop
  2. return, which leaves the whole function
  3. goto, which jumps to a labelled statement
  4. break, which transfers control after the construct Correct answer

Correct answer

D. break, which transfers control after the construct

13 views

MCQSEXAM

Explanation

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.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs