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