% or 'mod' is used with integer division.

int x = 9;

iny y = 5;

int z = 0;

z = x%y;

z is now equal to 4. the modulus gives you the remainder.

int x = 9;

iny y = 5;

int z = 0;

z = x%y;

z is now equal to 4. the modulus gives you the remainder.