ProgrammingHard

#define MAX(a, b) ((a) > (b) ? (a) : (b)) printf("%d", MAX(3, 2 + 2)); What is printed?

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

Correct answer: D. 4

The argument 2 + 2 is fully evaluated inside the macro's parentheses, so the larger value 4 is printed.

More C Programming questions

Exams that ask this topic