Multiple choice technology programming languages

What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6?

  1. 1.66

  2. 4

  3. 1

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The % operator returns remainder of division. 10 / 6 = 1 remainder 4. Therefore 10 % 6 = 4. This is the modulo operation.