Write a program to input a number and check number is positive,negative or nuteral.

In this program input a number and check number is positive, negative or nuteral. If number is greater than Zero then print positive , if less than zero then print negative and if both condition false then print nuteral.



#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter a number=");
scanf("%d",&n);
if(n>0)
printf("Positive number");
else if(n<0)
printf("Negative number");
else
printf("Nuteral");
getch();
}

OUTPUT 

Enter a number=4
Positive number
               Or
Enter a number=-4
Negative number
               Or
Enter a number=0
Nuteral

Related Examples 
1.Write a program to input a number and check number is positive or not.
2.Write a program to input a number and check number is negative or not. 

Follow for recently updates on Google+ or subscribe. 

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.