Output of: int a = 10, b = 3; printf("%d", a % b);

Output of:
int a = 10, b = 3;
printf("%d", a % b);

Answer: B. 1The modulus operator gives the remainder after integer division. Since 10 divided by 3 leaves remainder 1, the output is 1.

  1. A.

    0

  2. B.

    1

  3. C.

    3

  4. D.

    10

Attempted by 765 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.

Explore the full course: Coal India Management Trainee

Loading lesson…