← Quiz: C Output Questions: all 10 questions
Quiz: C Output Questions · Question 4 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
#define SQ(x) x * x
int main(void) {
printf("%d", SQ(4 - 1));
return 0;
}
- A.9
- B.-1
- C.15
- D.3
Answer & explanation
Correct answer: -1
It expands to 4 - 1 * 4 - 1 = 4 - 4 - 1 = -1.
Can you get the rest right without peeking?
Take the timed Quiz: C Output Questions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →