Question: In C++ please Integer numElements is read from input. Given the integer vector averagePrices with the size of numElements. write a for loop to initialize

Integer numElements is read from input. Given the integer vector averagePrices with the size of numElements. write a for loop to initialize the first half of averagePrices with the remaining integers read from input, in reverse order. Ex if the input is 8 99109117.121 then the output is: 1211171099900 Note. The vector size is always even. int main() \{ vectori; int numElements; cin numElements; /I Creates a vector of size numElements and initialize all values to averageprices. resize(numelements); I/your code herd for (i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
