C++ Program to Check if Given Number is Positive

Write C++ Program to check if given number is positive

// CPP Program to check if given number is positive

#include <iostream>

using namespace std;

int main()
{
	int n;

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

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

Output:

Enter the number :--> -9
The given number is not positive

Enter the number :--> 0

≪ Previous | Next ≫