1.

What is the output of this program?
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<int> VectorData (6);
int* ptr = VectorData.data();
*ptr = 30;
++ptr;
*ptr = 15;
ptr[2] = 150;
for (unsigned k = 0; k < VectorData.size(); ++k)
cout << ' ' << VectorData[k];
return 0;
}

A. 30 15 0 150 0 0
B. 30 15 0 150 0
C. 30 15 0 150
D. 30 15 0
E. 30 15
Answer» B. 30 15 0 150 0


Discussion

No Comment Found

Related MCQs