Contibuted by: BraydonKains
This is the way everyone in the Programmer Nullposting group says is the best.
bool isEven(int x) {
return x % 2 == 0;
}Contibuted by: Jared0801
This way is slightly more optimized (depending on the compiler) and almost as short, but possibly harder to read.
bool isEven(int x) {
return (x & 0x1) == 0;
}