Answers for "Given the following declarations below. Write a loop to read a list of numbers from the keyboard terminated by -999 and store the even numbers (skip over the odd numbers) in the vector v."

C++
0

Given the following declarations below. Write a loop to read a list of numbers from the keyboard terminated by -999 and store the even numbers (skip over the odd numbers) in the vector v.

cin >> x;

while (x != -999) {

     if (x % 2 == 0) 

     {

          v.push_back(x);

     }

    cin >> x;

}
Posted by: Guest on April-07-2021

Code answers related to "Given the following declarations below. Write a loop to read a list of numbers from the keyboard terminated by -999 and store the even numbers (skip over the odd numbers) in the vector v."

Browse Popular Code Answers by Language