Multiple choice technology programming languages

main(){ int x=5; printf("%d %d %d\n", x,x<<2,x=x>>2); }

  1. 5 4 1

  2. 1 4 1

  3. 5 20 1

  4. Compile error

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

In C, function arguments are evaluated from right to left in many compilers (like GCC). Evaluating x=x&gt;&gt;2 first shifts 5 right by 2, making x equal to 1. Then x&lt;&lt;2 evaluates to 4, and the final x is 1, resulting in '1 4 1'.