Saturday, September 6, 2014

C PROGRAM FIND GIVEN NUMBER IS EVEN POSITIVE or EVEN NEGATIIVE or ODD POSITIVE or ODD NEGATIVE

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("\nEnter Any Number : ");
scanf("%d",&n);

if(n>0)
{
  if(n%2==0)
  {
  printf("\nEVEN POSITIVE NUMBER ");
  }
  else
  {
  printf("\nODD POSITIVE NUMBER ");
  }
}
else if(n%2==0)
{
printf("\n EVEN NEGATIVE NUMBER ");
}
else
{
printf("\n ODD NEGATIVE NUMBER ");
}
getch();

}

No comments:

Post a Comment

Computer Network & Computer Features | Bal Varg | Computer Questions List!

  Computer Network & Computer Features 1) _______ is a thin strip like bar present at the bottom of the screen.   Taskbar 2) _______ ser...