0 of 10 problems solved • 0%
Use in a course

Exercise prompt

Find the Remainder

The remainder operator % reports what is left after making equal groups. It does not calculate the size of each group.

Example

const stickers = 14; const students = 4; const leftOver = stickers % students;

This leaves 2 stickers. Your exercise shares candies.

Your task

Share 17 candies among 5 children. Use % with the supplied variables to find leftovers; the console should display Left over: 2.

Hint

Division and remainder answer different questions about sharing.