Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scratchyourbrain/9e10c15eeba1bea744c6 to your computer and use it in GitHub Desktop.
Save scratchyourbrain/9e10c15eeba1bea744c6 to your computer and use it in GitHub Desktop.
C Program to Check Whether a Number is Even or Odd
#include <stdio.h>
int main()
{
int num;
printf("Enter an integer you want to check: ");
scanf("%d",&num);
if((num%2)==0) /* Checking whether remainder is 0 or not. */
printf("%d is even.",num);
else
printf("%d is odd.",num);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment