Good work! Let’s explore one more special math operator known as modulo.
- The modulo operator - represented in Java by the
%symbol - returns the remainder of dividing two numbers.
15 % 6 will return the value of
3, because that is the remainder left over after dividing 15 by 6.
Use the modulo operator to set the variable
myRemainder equal to
2. You can use any two numbers that return a remainder value of