The Remainder Hunt

Easy+15 XP

Mission Briefing

The King’s vault contains endless gold coins. They must be evenly distributed among the guards, but the King wants to know exactly how many coins will be left over for himself!

The Concept: The Modulo Operator

The % (Modulo/Remainder) operator doesn't give you the result of division; it gives you the remainder left over after dividing one number by another.

The Objective

Your function receives a dividend (the total coins) and a divisor (the number of guards).

  1. Calculate the remainder when the dividend is divided by the divisor.
  2. Return that remainder.

01EXAMPLE 1

Inputdividend = 10, divisor = 3
Output1

Constraints

  • Use the % operator.
FundamentalsOperators
JavaScript
Loading...
3 Hidden

Input Arguments

dividend10
divisor3

Expected Output

1

Click RUN to test your solution