Multiple choice

void main() { int choice=2; switch(choice) { default: printf("Default1");

case 1: printf("Case1"); break;

default: printf("Default2"); } }

  1. Compile-Time Error

  2. Default1Case1

  3. Default2

  4. Default1

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

A switch statement cannot have more than one default case. This code has two default labels (at the beginning and end), which violates C syntax rules. The compiler will report an error for duplicate default cases. The presence of the second default makes this code invalid.