C#: How to determine if a number is odd or even.

A popular way is to use the modulus operator:

if (variable % 2 == 0)
    return true;
else
    return false;