- Back to Home »
- C , code , coding , Numbers , project , project c++(basic) »
- Program to tell whether entered number is +ive,-ive or Zero
Posted by : Unknown
Saturday, 17 January 2015
//Program to tell whether entered number is +ive,-ive or Zero
#include<stdio.h>
#include<conio.h>
//main function
void main()
{
int x;
printf("Enter x:");
scanf("%d",&x);
if(x==0)
{
printf("The number is Zero");
}
else if(x>0)
{
printf("The number is Positive");
}
else if(x<0)
{
printf("The number is Negative");
}
getch();
}
#include<stdio.h>
#include<conio.h>
//main function
void main()
{
int x;
printf("Enter x:");
scanf("%d",&x);
if(x==0)
{
printf("The number is Zero");
}
else if(x>0)
{
printf("The number is Positive");
}
else if(x<0)
{
printf("The number is Negative");
}
getch();
}