Important MCQ

Which data type cannot be used in a switch expression?

Q.Which data type cannot be used in a switch expression?

A) short
B) float
C) char
D) int
Correct Answer:
Option B
Detailed Explanation:
B) float 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.