Programming Tips - What's the nicest way to test if a number is odd or even in C/C++ ?

Date: 2008jan17 Language: C/C++ Level: Beginner Q. What's the nicest way to test if a number is odd or even in C/C++ ? A. I think this pair of functions is about as nice as you can get:
inline bool isOdd(const int n) { return n % 2; }
inline bool isEven(const int n) { return ! isOdd(n); }
// Here's another approach looking at the low order bit. // May not work with negative numbers. inline bool isOdd(const int n) { return n & 1; }