ProgrammingHard

printf("%d", 10 % 3 * 2 ^ 1); What is printed?

  1. A. 3
  2. B. 2
  3. C. 0
  4. D. 5

Correct answer: A. 3

% and * are at the same level and group left to right, giving (10 % 3) * 2 = 2. Then 2 ^ 1 = 3.

More C Programming questions

Exams that ask this topic