1.

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

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


Discussion

No Comment Found

Related MCQs