ProgrammingVery hardProduct company OA

What is printed?

What is printed?
#define CAT(a, b) a##b
printf("%d", CAT(1, 2) + CAT(0x, 1F));
  1. A. 3
  2. B. Compilation error
  3. C. 13
  4. D. 43

Correct answer: D. 43

## glues tokens into a single token: 1 and 2 become 12, and 0x and 1F become the hexadecimal constant 0x1F = 31. 12 + 31 = 43. '3' assumes the arguments are added before pasting.

More C Programming questions

Exams that ask this topic