C++ program to check whether a number is positive or negative

0
26

Here is the C++ program to check whether a number is positive or negative:

#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter Number : "; cin>>num;
if(num>0)
{
cout<<"Number is Positive \n";
}
else if(num<0)
{
cout<<"Number is Negative \n";
}
else
{
cout<<"Zero \n";
}
return 0;
}

Output:

program to check whether a number is positive or negative