-
What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int Array[]={ 110, 220, 230, 440, 550 };
vector<int> VectorData (5, 85);
iter_swap(Array, VectorData.begin());
iter_swap(Array + 4,VectorData.begin() + 3);
for (vector<int> :: iterator Iter = VectorData.begin();
Iter != VectorData.end(); ++Iter)
cout << ' ' << *Iter;
return 0;
}
-
- 110 220 230
- 110 85 85 550 85
- 110 85 85
- 85 550 85
- Compilation Error
Correct Option: B
In this program, We are swapping the certain values in two vectors by using iter_swap.