Machine-translated by Google. Questions are authored in English.
Top

Discussion

The value of 351 mod 5 is __________.

  • A.0
  • B.1
  • C.5
  • D.8

Answer: B

351 mod 5 is 1.

The mod operation gives the remainder after division: 351 = 5 × 70 + 1, so the remainder is 1. A quick check is that a number's remainder on division by 5 depends only on its last digit, and 1 leaves remainder 1.

0 would need the number to end in 0 or 5. A remainder on division by 5 is always between 0 and 4, so 5 and 8 are impossible.

In programming terms this is 351 % 5, which also evaluates to 1.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.