bool IsEven(int i)
{
    if (i < 0)
        i *= -1;
        
    while(i > 0)
        i -= 2;
    
    if (i == -1)
        return false;
    else
        return true;
}

An is even function that is technically correct, but a really bad approach.

By Chris Mallery, 2017-12-12 17:34:42