To be exact, the code to do this would look like this:
int num1 = 6;
Doing "int % 2" will give you either the number 0 or 1. If the result is 0, it means it is even. If the result is 1, it means it is odd.
Basically, mod ( % ) will grab the two number, divide them, and return the remainder. If you divide 4 by 2, you get 2 with a remainder of 0, so it returns 0. If you divide 3 by 2, you get 1 with a remainder of 1, so it returns 1.
You can do the same thing if you needed to find out if a number was divisible by something. For instance, if you needed to know if 40 was divisible by 10, you would simply code "40%10" and it would return 0, which would indicate that it is divisible by 0. If you did "45%10" it would return 5, because 5 is the remainder of 45/10.
I dont think I can explain it any more detailed then that. Once you get used to using mod, you will find out how extremely useful it is.