< Previous | Contents | Next >

Using the Modulus Operator

In the next statement, I use an operator that might be unfamiliar to youthe modulus operator (%). The modulus operator returns the remainder of integer division. In this case, 7 % 3 produces the remainder of 7 / 3, which is 1.