Question: Following code successfully reverses prices vector. for ( i = 0 ; i < ( prices . size ( ) / 2 ) ; +

Following code successfully reverses prices vector.
for (i =0; i <(prices.size()/2); ++i){
tmp = prices.at(i);
prices.at(prices.size()- i -1)= tmp;
prices.at(i)= prices.at(prices.size()-1- i);
}
Following code successfully reverses prices vector.
for (i =0; i <(prices.size()/2); ++i){
tmp = prices.at(i);
prices.at(prices.size()- i -1)= tmp;
prices.at(i)= prices.at(prices.size()-1- i);
}
True
False

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 Databases Questions!