Multiple choice

What is the output of the given code?

int main()
 {
 switch(printf("%d\\n",pow(128>>3>>2>>1,3)))
 {
 case 56/4 : printf("Hello"); case 32/4 :
printf("Bye"); case 0/9 :
printf("Good"); case 0/1 :
printf("Bad");
 }
 }

  1. 0 GoodBad

  2. 8ByeGoodBad

  3. 14HelloByeGoodBad

  4. 16

  5. Compiler error

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

This is the correct choice because the last two cases: “case 0/9” and “case 0/1” both will evaluate to 0. But we cannot have two duplicate case values, so the compiler will raise an error.