ToniDev

For Loop

Dec 3rd, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.    
  7.     int a, n;
  8.  
  9.     cout << "Introdu n: ";
  10.     cin >> n;
  11.  
  12.     for (int i = 0; i < n; i++)
  13.     {
  14.         cout << "Introdu numarul: ";
  15.         cin >> a;
  16.  
  17.         if (a % 2 == 0)
  18.         {
  19.             cout << "OK" << endl;
  20.         }
  21.         else
  22.         {
  23.             cout << "nu e par." << endl;
  24.         }
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment