ProgrammingModerateTCS NQT · Infosys pattern

What is printed?

What is printed?
printf("%d", 10 / 3 * 3);
  1. A. 10
  2. B. 1
  3. C. 9
  4. D. 3

Correct answer: C. 9

/ and * have equal precedence and group left to right: 10 / 3 = 3 (integer division drops the fraction), then 3 × 3 = 9. Getting 10 means treating it as real division.

More C Programming questions

Exams that ask this topic