Skip to content

Instantly share code, notes, and snippets.

@saiedabbas93
Created August 15, 2019 19:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saiedabbas93/ee731ef3f689f8c20361ba7405901859 to your computer and use it in GitHub Desktop.
Save saiedabbas93/ee731ef3f689f8c20361ba7405901859 to your computer and use it in GitHub Desktop.
Any integer is input through the keyboard. Write a program to find out whether it is an odd number or even number.
#include<stdio.h>
#include<conio.h>
void main()
{
int num,result;
printf("Enter the number\n");
scanf("%d",&num);
result=num%2;
if (result==0)
printf("Number is even");
else
printf("Number is odd");
}
Enter the number
100
Number is even
PS C:\Program code> cd "c:\Program code\" ; if ($?) { gcc odd_even.c -o odd_even } ; if ($?) { .\odd_even }
Enter the number
101
Number is odd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment