Skip to content

Instantly share code, notes, and snippets.

@zznop
Created December 16, 2017 21:41
Show Gist options
  • Save zznop/3982a5e11eb7b6794825623e3d6df305 to your computer and use it in GitHub Desktop.
Save zznop/3982a5e11eb7b6794825623e3d6df305 to your computer and use it in GitHub Desktop.
int is_odd(int number)
{
return number == 0 ? 0 : is_even(abs(number) - 1);
}
int is_even(int number)
{
return number == 0 ? 1 : is_odd(abs(number) - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment