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. code example
Example: 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;
}