adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <list>
    #include <string>
    #include <iostream>
    using namespace std ;
    typedef list<string> LISTSTR; 
    int main()
    {
        LISTSTR :: iterator i;
        LISTSTR test;
        test.insert(test.end(), "one");
        test.insert(test.end(), "two");
        LISTSTR test2(test);
        LISTSTR test3(3, "three");
        LISTSTR test4(++test3.begin(),
        test3.end());
        cout << "test:";
        for (i =  test.begin(); i != test.end(); ++i)
            cout << " " << *i << endl;
        cout << "test:";
        for (i =  test2.begin(); i != test2.end(); ++i)
            cout << " " << *i << endl;
        cout << "test:";
        for (i =  test3.begin(); i != test3.end(); ++i)
            cout << " " << *i << endl;
        cout << "test:";
        for (i =  test4.begin(); i != test4.end(); ++i)
            cout << " " << *i << endl;
    }

a.

test

b.

test one

c.

test two

d.

none of the mentioned

Answer: (d).none of the mentioned

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?