5%2=1
8%2=0
5%4=1
x%y gives you the remainder of x/y
also read that: http://en.wikipedia.org/wiki/Modular_arithmetic
Last edited on
A small correction: this above is equal to 1.
5%2=1 because 5 = 2 + 2 + 1
8%2=0 because 8 = 2 + 2 + 2 + 2
5%4=1 because 5 = 4 + 1
3%5=3 because 3 = 3 (no 5 is added)
Last edited on
5%2=1 because 5 = 2*2 + 1 and
3%5=3 because 3 = 5*0 + 3.
Thanks catfish. Pardon me.