Advertisement
Spocoman

01. Sign of Integer Numbers

Oct 26th, 2023
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void print(int n) {
  6.     cout << "The number " << n << " is " << (n > 0 ? "positive" : n < 0 ? "negative" : "zero") << ".\n";
  7. }
  8.  
  9. int main() {
  10.     int n;
  11.     cin >> n;
  12.    
  13.     print(n);
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement