Created
December 15, 2014 11:20
-
-
Save scratchyourbrain/9e10c15eeba1bea744c6 to your computer and use it in GitHub Desktop.
C Program to Check Whether a Number is Even or Odd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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