Check whether a number is negative, positive or zero with C language
#include <stdio.h>
int main()
{
int number;
printf("Enter any number: ");
scanf("%d", &number);
if (number > 0)
{
printf("number is POSITIVE");
}
if (number < 0)
{
printf("number is NEGATIVE");
}
if (number == 0)
{
printf("number is ZERO");
}
return 0;
}
Output:-
Enter any number: 5
number is POSITIVE
0 Comments