rishat06

2_2

Sep 16th, 2025 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | Source Code | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int number;
  6.    
  7.     cout << "Введите целое число: ";
  8.     cin >> number;
  9.    
  10.     if (number > 0) {
  11.         cout << "Число положительное" << endl;
  12.     } else if (number < 0) {
  13.         cout << "Число отрицательное" << endl;
  14.     } else {
  15.         cout << "Число равно нулю" << endl;
  16.     }
  17.    
  18.     if (number != 0) {
  19.         if (number % 2 == 0) {
  20.             cout << "Число четное" << endl;
  21.         } else {
  22.             cout << "Число нечетное" << endl;
  23.         }
  24.     }
  25.    
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment