adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <map>
    using namespace std;
    int main ()
    {
        multimap<char, int> mymultimap;
        mymultimap.insert(make_pair('y', 202));
        mymultimap.insert(make_pair('y', 252));
        pair<char, int> highest = *mymultimap.rbegin();
        multimap<char, int> :: iterator it = mymultimap.begin();
        do 
        {
            cout << (*it).first << " => " << (*it).second << '\n';
        } while ( mymultimap.value_comp()(*it++, highest) );
        return 0;
    }

a.

y => 202

b.

y => 252

c.

y => 202 & y => 252

d.

None of the mentioned

Answer: (a).y => 202

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?