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

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi...

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi... : 1) Which of the following is NOT a web service? (...