C Program To Check Number Is Positive Or Negative: In the following program, we are checking whether the input integer number is positive or negative. If the input number is greater than zero then it’s positive else it is a negative number.
C Program To Check Number Is Positive Or Negative
#include<stdio.h>
int main()
{
int a;
printf("Enter The Number You Want To Check :\n");
scanf("%d",&a);
if(a<0)
{
printf("Number Is Negative:\n");
}
else if(a>0)
{
printf("Number Is Possitive:\n");
}
else
{
printf("You Enter Zero :\n");
}
return 0;
}
Output of Program
Enter The Number You Want To Check :
56
Number Is Possitive: