← 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;
}
- A.3 6
- B.4 6
- C.4 8
- 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 →