Write a C++ Program to Check Whether a Number is a Positive or Negative Number.

C++// C++ Program to check whether a number is positive or // negative #include <iostream> using namespace std; int main() { int number; number = -100; if (number >= 0) { cout << number << " is a positive number." << endl; } else { cout << number << " is a negative number." << endl; } return 0; }

Output

-100 is a negative number.

Comments

Leave a Reply

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