C Program to Check the Number is Positive, Negative or Zero
#include<stdio.h>
void main(){
int num;
printf("Enter Any Number");
scanf("%i", &num);
if(num > 1)
{
printf("The number is positive");
}
else if(num < 0)
{
printf("The number is negative");
}
else if(num == 0)
{
printf("The number is Zero");
}
else
{
printf("Invalid Input!");
}
}
void main(){
int num;
printf("Enter Any Number");
scanf("%i", &num);
if(num > 1)
{
printf("The number is positive");
}
else if(num < 0)
{
printf("The number is negative");
}
else if(num == 0)
{
printf("The number is Zero");
}
else
{
printf("Invalid Input!");
}
}
Comments
Post a Comment