Uses of Modulus
Even and Odd
5 % 2 = 1 odd 4 % 2 = 0 even
Take the modulus by 2 of any integer, a result of 1 means the number was odd, a result of 0 means the number was even.
The Euclidean GCD algorithm
Previous slide
Next slide
Back to first slide
View graphic version