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.

Relax

Respuesta :

#include <iostream>

#include <string>

int main(){

int number = 1;

while(number >= 1){

   std::cin >> number;

   if((number % 2) == 0){

       std::cout << number << " ";

       }

   }

   return 0;

}