source file name: psngodeven.C
void main()
{
int n;
clrscr();
printf("Odd or Even or +Ve or -Ve program");
printf("\n enter any number");
scanf("%d",&n);
if(n%2==0)
printf("\n Given no: %d is Even number",n );
else
printf("\n Given no: %d is Odd number",n );
if(n==0)
printf("\n Given no is Zero number",n );
else
{
if(n>0)
printf("\n Given no: %d is Positive number",n );
else
printf("\n Given no: %d is Negative number",n );
}
getch();
}
output:
1. Odd or Even or +Ve or -Ve program");
enter any number
-15
Given no: -15 is Odd number
Given no: -15 is Negative number
2. Odd or Even or +Ve or -Ve program");
enter any number
10
Given no: 10 is Even number
Given no: 10 is Positive number
0 Comments
Post a Comment