The modulus operator would be useful for that exercise. It returns the remainder after a division: 10 % 3 = 1
Returning 0 would mean an even division.

Use it in an if statement: if(condition1...