Write a loop that reads positive integers from console input, printing out those values that are even, separating them with spaces, and that terminates when it reads an integer that is not positive.

PHOTO EMBED

Fri Sep 22 2023 21:06:14 GMT+0000 (Coordinated Universal Time)

Saved by @David_Mix

int x;
cin >> x;
while (x > 0) 
{
  if (x % 2 == 0)
    cout << x << " ";
  cin >> x;
}
content_copyCOPY