← Quiz: C Introduction: all 10 questions
Quiz: C Introduction · Question 6 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
printf("%d\n", (2 + 3) * 4 - 6 / 2);
return 0;
}
- A.7
- B.17
- C.20
- D.14
Answer & explanation
Correct answer: 17
The brackets come first (5), then * and / from left to right: 5 * 4 = 20 and 6 / 2 = 3, so 20 - 3 = 17.
Can you get the rest right without peeking?
Take the timed Quiz: C Introduction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →