Advertisement
hopingsteam

Untitled

Jan 30th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include    <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a = 5;
  8.  
  9.     cout << "Numarul este mai mic ca 10?";
  10.    
  11.     // Expresie logica (0 - fals | 1 - adevarat)
  12.     // (|| - operatorul sau) (&& - operatorul si)
  13.     if(a < 10)
  14.         cout << "DA";
  15.     else
  16.     {
  17.         cout << "NU";
  18.         cout << "!";
  19.     }
  20.     cout << "\n";
  21.  
  22.     int x;
  23.     cout << "x = "; cin >> x;
  24.     cout << "Numarul este: ";
  25.     if(x % 2 == 0) // Verifica daca numar este par
  26.         cout << "par\n";
  27.     else
  28.         cout << "impar\n";
  29.  
  30.     //while()
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement