🎙 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 5 of 10

What does this print? (code)

What does this print?

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

Correct answer: 10

10 / 4 = 2, × 4 = 8, plus 10 % 4 = 2 → 10.

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 →