Question: Jump to level 1 Integer numDistance is read from input as the number of elements in the vector that follows. Then, numDistance elements are read

Jump to level 1
Integer numDistance is read from input as the number of elements in the vector that follows. Then, numDistance elements are read from input into the vector bikingListings. Use a loop to access each element in the vector and if the element is an even number, output the element followed by a newline.
Ex: If the input is
7
\(97\quad 94188\quad 158\quad 58\quad 15\quad 168\)
then the output is:
94
188
158
58
168
Note: \( x \%2==0\) is true if \( x \) is even
```
int main(){
vector bikingListings;
int numDistance;
int inVal;
unsigned int i;
cin >> numDistance;
for (i =0; i numDistance; ++i){
cin >> inVal;
bikingListings.push_back(inVal);
}
/* Your code goes here */
return 0;
}
```
Jump to level 1 Integer numDistance is read from

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!