fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout << "Input number of values : ";
  8. int num;
  9. cin >> num;
  10.  
  11. int counter = 0;
  12. int i;
  13. while (counter < num)
  14. {
  15. cin >> i;
  16.  
  17. if (i % 2 == 0)
  18. {
  19. cout << i << " Is even ";
  20. }
  21. else
  22. {
  23. cout << i << " is odd ";
  24. }
  25.  
  26. counter++;
  27. }
  28.  
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 4540KB
stdin
4 1 2 3 4
stdout
Input number of values : 1 is odd 2 Is even 3 is odd 4 Is even