fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cout << "Enter a number: ";
  8. cin >> n;
  9.  
  10. if (n > 0)
  11. cout << n << " is a Positive number";
  12. else if (n < 0)
  13. cout << n << " is a Negative number";
  14. else
  15. cout << "The number is Zero";
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5320KB
stdin
-26
stdout
Enter a number: -26 is a Negative number