C++ Program to Check if Given Number is Positive or Negative

C++ Program to Check if Given Number is Positive or Negative

Write C++ Program to Check if Given Number is Positive or Negative

// CPP Program to check if given number is positive or negative

#include <iostream>

using namespace std;

int main()
{
	int n;

	cout << "Enter the number :--> ";
	cin >> n;

	if(n > 0)
	{
		cout << "The given number is positive";
	}
	else
	{
		cout << "The given number is negative";
	}

	return 0;
}

Output:

Enter the number :--> 8
The given number is positive

Enter the number :--> -9
The given number is negative