Created
August 15, 2019 19:44
-
-
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.
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> | |
#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"); | |
} |
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
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