I am new to Java, actually programming in general. I understand that the modulus operator (%) returns the remainder of two numbers, however, I do not understand why 17 % 40 = 1
When you divide 17/40, quotient is 0 and the remainder is 17.
The modulo operator (%) returns the remainder.
%
i.e
a % b = remainder of a / b