modulo operator multiples, explain how it works code example
Example: modulo operator multiples, explain how it works
1 % 5 = 1
// 1 cannot be divided by 5, so the remainder is 1
4 % 5 = 4
// 4 cannot be divided by 5, so the remainder is 4
7 % 5 = 2
// 7 divided by 5 equals 1, with a remainder of 2
25 % 5 = 0
// 25 divided by 5 equals 5, with a remainder of 0
218 % 5 = 3
// 218 divided by 5 equals 43, with a remainder of 3