1.

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

A. 5
B. 5 4
C. 5 4 4 5 0
D. 5 4 4 5
E. 5 4 4
Answer» D. 5 4 4 5


Discussion

No Comment Found

Related MCQs