C program to check whether a number is positive, negative or zero - C Program

C program to check whether a number is positive, negative or zero

    
#include <stdio.h>
int main()
{
   int num;
    
  
    printf("Enter any number: ");
    scanf("%d", &num);
    
    if(num > 0)
        printf("Number is Positive");
    else if(num < 0)
        printf("Number is Nagative");
    else
        printf("Number is ZERO");
    
    return 0;
   
}

Output - C program to check whether a number is positive, negative or zero

Enter any number: 22                                                                                                  
Number is Positive   
Compile and Run Online