Program in c to check given number is positive or negative :
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("Enter the number: ");
scanf("%d",&num);
if(num > 0)
{
printf("\n Given number is Positive");
}
else
if(num < 0)
{
printf("\n Given number is Negative");
}
else
{
printf("\n Invalid Input");
}
getch();
}
Output:
Enter the number: 91
Given number is Positive
OR
Enter the number: -456
Given number is Negative