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

12th January Swami Vivekanand Jayanti: National Youth Days

The day serves as a reminder to the youth of India to remain steadfast in their goals and contribute positively to society. Swami Vivekanand...