Skip to content

Instantly share code, notes, and snippets.

@amarjeetsahoo
Created November 3, 2020 05:54
Show Gist options
  • Save amarjeetsahoo/339c6da4382f4ab19e462b29f2d8d906 to your computer and use it in GitHub Desktop.
Save amarjeetsahoo/339c6da4382f4ab19e462b29f2d8d906 to your computer and use it in GitHub Desktop.
Program to check if the number is odd or even by divide and multiply by 2
#include <stdio.h>
int main()
{
int n;
printf("Enter a number");
scanf("%d",&n);
if((n/2)*2==n) printf("%d is Even",n);
else printf("%d is Odd",n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment