Check whether number is positive, negative, even or odd

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("enter the no");
scanf("%d",&n);
if(n>0)
{
printf("\nnumber is +ve");
if(n%2==0)
printf("\n number is even");
else
printf("\n number is odd");
}
if(n<0)
printf("\n number is -ve");
getch();
}

1 comment:

  1. Appreciation for nice Updates, I found something new and folks can get useful info about BEST ONLINE TRAINING

    ReplyDelete