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
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
quad quad quad quad quad
then the output is:
Note: x is true if x is even
int main
vector bikingListings;
int numDistance;
int inVal;
unsigned int i;
cin numDistance;
for i ; i numDistance; i
cin inVal;
bikingListings.pushbackinVal;
Your code goes here
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
