Multiple choice

What is the output of the given C program?

int main()
{
int i = (1048576>>8>>3>>8>>3) + + - + (1024<<8<<3>>8>>3);
switch(i) // Line 1
{
default : printf("Good Bye");
case 1024 : printf("\\n%d\\n",1024<<8<<3>>8>>3);
case 512 : printf("%d\\n",1024<<2>>3<<2);
case 1 : printf("%d\\n",1024<<3<<8>>3>>3);
}
return 0;
}

  1. Good Bye 1024 2048 32768

  2. 1024 2048 32768

  3. 2048 32768

  4. 32768

  5. Compilation error

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

This expression is evaluated as follows: (1024*(2^8)(2^3)) / ((2^8)/(2^3)) - (1024(2^8)*(2^3)) / ((2^8)/(2^3)) = -1024