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

Quiz: C Data Types and Operators · Question 3 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
int main(void) {
    int x = 3;
    int y = x++ * 2;
    printf("%d %d", x, y);
    return 0;
}
  1. A.3 6
  2. B.4 6
  3. C.4 8
  4. D.3 8
Answer & explanation

Correct answer: 4 6

x++ uses 3 (so y = 6), then x becomes 4.

Can you get the rest right without peeking?

Take the timed Quiz: C Data Types and Operators quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →