Skip to content

Instantly share code, notes, and snippets.

@anonur
Last active April 4, 2019 19:11
Show Gist options
  • Save anonur/1cc93933745345843e73d57f924a711f to your computer and use it in GitHub Desktop.
Save anonur/1cc93933745345843e73d57f924a711f to your computer and use it in GitHub Desktop.
decides if the given number is even or odd
#include<stdio.h>
int main()
{
int x;
printf("Enter an integer: ");
scanf("%d",&x);
if(x % 2 == 0) {
printf("This number is even.\n");
}
else
printf("This number is odd.\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment