The simple way is to just check the number mod 2. If you get 1 it's
odd, otherwise even. The somewhat faster way on many systems
(although it probably won't matter unless you execute this code
millions of times in a loop) would be to check the bitwise and of the
number with 1. Again, if the result is 1 the number is odd,
otherwise even.