adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <set>
    using namespace std;
    int main()
    {
        set<int> tst;
        tst.insert(12);
        tst.insert(21);
        tst.insert(32);
        tst.insert(31);
        set<int> :: const_iterator pos;
        for(pos = tst.begin(); pos != tst.end(); ++pos)
        cout << *pos << ' ';
        return 0;
    }

a.

12 21 32 31

b.

12 21 31 32

c.

12 21 32

d.

12 21 31

Answer: (b).12 21 31 32

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?