Output of: int a = 10, b = 3; printf("%d", a % b);
Output of:
int a = 10, b = 3;
printf("%d", a % b);
Answer: B. 1 — The modulus operator gives the remainder after integer division. Since 10 divided by 3 leaves remainder 1, the output is 1.
- A.
0
- B.
1
- C.
3
- D.
10
Attempted by 762 students.
Show answer & explanation
Correct answer: B
The modulus operator gives the remainder after integer division. Since 10 divided by 3 leaves remainder 1, the output is 1.
Loading lesson…