ProgrammingHardTCS NQT · Infosys

What is the value of 1 + 2 * 3 << 1 in C?

  1. A. 8
  2. B. 7
  3. C. 14
  4. D. 12

Correct answer: C. 14

Multiplication binds first, then addition, and shifts bind last: (1 + 6) << 1 = 14. Shifts sit below additive operators in the precedence table.

More C Programming questions

Exams that ask this topic