Important MCQ

A switch expression can be of type

Q.A switch expression can be of type

A) string
B) float
C) int or char
D) double
Correct Answer:
Option C
Detailed Explanation:
C) int or char is correct. switch performs multi-way selection using integral or enum-like values such as int and char. Case labels are constants; break exits the switch, while missing break can cause fall-through.