Multiple choice technology programming languages

(modulo -15 4) the output will be:

  1. 3

  2. -3

  3. 1

  4. -1

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

In Scheme, modulo always returns a result with the same sign as the divisor (second argument). modulo -15 4 = -15 - 4*floor(-15/4) = -15 - 4*(-4) = -15 + 16 = 1. The result has the same sign as 4 (positive).