Multiple choice technology programming languages

The output of operation 20%3 is

  1. 6

  2. 2

  3. 1

  4. 4

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

The modulo operator (%) returns the remainder after division. When 20 is divided by 3, we get 3 × 6 = 18 with a remainder of 2. Therefore, 20 % 3 equals 2.