adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <set>
    using namespace std;
    int main ()
    {
        multiset<int> mymultiset;
        for (int i = 0; i < 5; i++) mymultiset.insert(i);
        multiset<int> :: key_compare mycomp = mymultiset.key_comp();
        int highest = *mymultiset.rbegin();
        multiset<int> :: iterator it = mymultiset.begin();
        do 
        {
            cout << ' ' << *it;
        } while (mycomp(*it++, highest));
        return 0;
    }

a.

12345

b.

01234

c.

1234

d.

0123

Answer: (b).01234

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?