Like if you wanted to do regular division, it'd be just "5/3", but that'd return a decimal.
In which case, your code wouldn't be seeing an "int" value, it'd be seeing a "double". (double is the variable type for decimals. just as int is the variable type for integer).
However, instead of returning a decimal, asking for just the remainder would be taking the amount that didn't divide wholly.
So for the 2nd example, if you did 7 divided by 3, you'd take the 1 and leave the 2. Since 3x2 is 6 with 1 left over to make it 7. The 1 being the remainder.
So 7%3 = 1
Whereas 7/3 = 2.3333
So in the example where it's X%2, we know that if the remainder is 0, then the number will always be an even number because anything divisible by two as a whole number is even. Anything not divisible by 2 is an odd number. A basic math principle.
Wah, i feel like a math teacher LOL