C Program to check whether a given number is Positive or Negative in simple way

C Program to check whether a given Number is Positive or Negative

C Program to check whether a given number is Positive or Negative 

    1. #include <stdio.h>
    2. void main()
    3. {
    4.    int num;
    5.    printf("Enter a number: \n");
    6.    scanf("%d", &num);
    7.             if (num > 0)
    8.                 printf("%d is a positive number \n", num);
    9.             else if (num < 0)
    10.                 printf("%d is a negative number \n", num);
    11. }


Post a Comment

0 Comments