Question 31Asked in DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

What will happen if we DO NOT use the break statement in a switch case?

  1. AThe program will throw a compilation error.
  2. BThe control will continue executing the following cases until the end of the switch block is encountered.
  3. CThe control will break out of the switch automatically after the first matching case.
  4. DThe program will throw a runtime error.
Show answerHide answer

Correct answer: (B) The control will continue executing the following cases until the end of the switch block is encountered.

Explanation

Without break, execution falls through: after the matching case, the statements of all the following cases run until a break or the end of the switch.

From DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

This is question 31 of DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.