If you exchange 372 pennies for dollar bills, how many bills do you get? How many pennies are left over?
372 / 100 == 3
372 % 100 == 72
For positive numbers, INT % X
means to fit as many X
as you can
into INT
, and then the left over amount is the value of the expression.
Try that with the following:
If X
is odd, what is X%2
?