Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <vector>
    using namespace std;
    int main ()
    {
    unsigned int k;
    vector<int> One;
    vector<int> Two (3, 50);
    vector<int> Three (Two.begin(), Two.end());
    vector<int> Four (Three);
    int Array[] = {10, 12, 71, 38};
    vector<int> Five (Array, Array + sizeof(Array) / sizeof(int) );
    for (vector<int> :: iterator it = Five.begin(); it != Five.end(); ++it)
    cout << ' ' << *it;
    return 0;
    }
    1. 10 12 71 38
    2. 10 12 71
    3. 10 12
    4. 10
    5. None of these
Correct Option: A

In this program, We got the values and printing it by using the vector and we are contructing vectors.



Your comments will be displayed only after manual approval.