Question 25Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

Which of the following is true about nested switch statements in C?

  1. ABoth inner and outer switch statements must have a default case.
  2. BA switch statement cannot contain another switch.
  3. CInner switch cases should not contain break statement
  4. DA switch statement can contain another switch statement inside any of its cases.
Show answerHide answer

Correct answer: (D) A switch statement can contain another switch statement inside any of its cases.

Explanation

C allows switch statements to be nested: any case of an outer switch can contain a complete inner switch. A default case is optional and break is allowed inside inner cases.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 25 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). 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.