adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <iterator>
    #include <vector>
    using namespace std;
    int main () 
    {
        vector<int> myvector;
        for (int i = 1; i < 4; ++i) 
            myvector.push_back(i*10);
        ostream_iterator<int> out_it (cout,", ");
        copy ( myvector.begin(), myvector.end(), out_it );
        return 0;
    }

a.

10, 20, 30

b.

10, 20

c.

10, 20, 30,

d.

None of the mentioned

Answer: (c).10, 20, 30,

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?