ProgrammingHardGATE CS · Campus placements

#define CAT(a,b) a##b. After int CAT(num, 2) = 7; what does printf("%d", num2 * 2) print?

  1. A. 14
  2. B. 7
  3. C. 9
  4. D. num2

Correct answer: A. 14

The ## operator pastes the two tokens into one identifier, num2, before compilation. So num2 is the variable 7 and the output is 14.

More C Programming questions

Exams that ask this topic