//C Program To find whether a Number is Even or Odd using Conditional Operator
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter any Number\n\n");
scanf("%d",&n);
(n%2==0)?printf("\nEven Number"):printf("\nOdd Number");
getch();
}
Hope you liked my posts, give comments if you have any doubts.. :)#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter any Number\n\n");
scanf("%d",&n);
(n%2==0)?printf("\nEven Number"):printf("\nOdd Number");
getch();
}
Categories:
c program
0 comments:
Post a Comment