C Program to check given number is positive or Negative using If condition

Spread the love

Description :

This program accepts one integer from user and checks given number is positive or negative.

Program :

  1. #include<stdio.h>
  2. int main()
  3. {
  4.    int num;
  5.    printf(“Enter any Number : “);
  6.    scanf(“%d”,&num);
  7.    if(num == 0)
  8.    {
  9.       printf(“Number is Zeron);
  10.    }
  11.    else if(num > 0)
  12.    {
  13.       printf(“Given Number is Positive Number n);
  14.    }
  15.    else
  16.    {
  17.       printf(“Given Number is Negative Number n);
  18.    }
  19.    return 0;
  20. }

Output :

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply