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).
- Calculate the remainder when the dividend is divided by the divisor.
- Return that remainder.
01EXAMPLE 1
Input
dividend = 10, divisor = 3Output
1Constraints
- Use the % operator.
FundamentalsOperators
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
dividend10
divisor3
Expected Output
1
Click RUN to test your solution