By using this site, you agree to our Privacy Policy and our Terms of Use. Close

You'd have to check if the number is equally divisible by 2, try an if statement like..

if(n % 2 == 0)

I think that ought to work, there are a lot more ways to do it most likely.