🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Files and Preprocessor: all 10 questions

Quiz: Files and Preprocessor · Question 6 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
#define SQ(x) x * x
int main(void) {
    printf("%d\n", SQ(2 + 3));
    return 0;
}
  1. A.25
  2. B.11
  3. C.10
  4. D.13
Answer & explanation

Correct answer: 11

The macro is pasted as text: 2 + 3 * 2 + 3 = 11. Writing ((x) * (x)) gives 25.

Can you get the rest right without peeking?

Take the timed Quiz: Files and Preprocessor quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →