C Program to Check if a given Integer is Positive or Negative

#include <stdio.h>
 
void main()
{
 int number;
 
 printf("Enter a number \n");
 scanf("%d", &number);
 if (number >= 0)
 printf("%d is a positive number \n", number);
 else
 printf("%d is a negative number \n", number);
}

Leave a Reply

Your email address will not be published. Required fields are marked *