🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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;
}
  1. A.9
  2. B.-1
  3. C.15
  4. 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 →