C Program to Check the Number is Positive, Negative or Zero

Check the Number is Positive, Negative or Zero in C language


#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!");
}

}

Comments

Popular posts from this blog

Pseudocode to Check, Number is Odd or Even

How to Create Marksheet in C