Multiple choice technology programming languages

#include int main() { float dennis; switch(dennis) { default: printf("Let me work"); case 1: printf("This is case 1"); case 2: printf("This is case 2"); break; } }

  1. Let me work

  2. Let me workThis is case 1This is case 2

  3. Compilation Error

  4. Run Time Error

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

In C, the switch statement requires an expression of integer type (int, char, enum). A float variable cannot be used as the switch expression because float values are not discrete and cannot be compared exactly for equality matching. This code will fail to compile with an error about illegal switch expression type. Options A and B would be outputs if the code compiled, but compilation never succeeds.