Which of the following is true about nested switch statements in C?
ABoth inner and outer switch statements must have a default case.
BA switch statement cannot contain another switch.
CInner switch cases should not contain break statement
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.