Multiple choice

Switch cannot have a ______ type value?

  1. int

  2. char

  3. float

  4. none of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The switch statement in C requires the controlling expression to be of an integral type, such as int, char, or an enumeration. Floating-point values are not allowed because they cannot be reliably checked for exact equality due to precision issues.