adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <algorithm>
    #include <vector>
    using namespace std;
    int main ()
    {
        int myints[]={ 10, 20, 30, 40, 50 };
        vector<int> myvector (4, 99);
        iter_swap(myints, myvector.begin());
        iter_swap(myints + 3,myvector.begin() + 2);
        for (vector<int> :: iterator it = myvector.begin(); 
            it != myvector.end(); ++it)
        cout << ' ' << *it;
        return 0;
    }

a.

10

b.

10 40

c.

10 99 40 99

d.

None of the mentioned

Answer: (c).10 99 40 99

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?