adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <set>
    using namespace std;
    int main ()
    {
        set<int> myset;
        myset.insert(20);
        myset.insert(30);
        myset.insert(10);
        while (!myset.empty())
        {
            cout << ' ' << *myset.begin();
            myset.erase(myset.begin());
        }
        cout << '\n';
        return 0;
    }

a.

10

b.

20

c.

30

d.

All of the mentioned

Answer: (d).All 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?