← 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;
}
- A.25
- B.11
- C.10
- 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 →