1.

What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
vector<int> num;
for (int k = 1; k < 6; ++k)
num.push_back(k);
rotate(num.begin(), num.begin() + 5, num.end( ));
for (vector<int> :: iterator Iter = num.begin();
Iter != num.end(); ++Iter)
cout << ' ' << *Iter;
return 0;
}

A. 1
B. 1 2
C. 1 2 3
D. 1 2 3 4
E. 1 2 3 4 5
Answer» F.


Discussion

No Comment Found

Related MCQs