1.

What is the output of this program?
#include <iostream>
#include <map>
using namespace std;
int main ()
{
multimap<char, int> MultimapData;
MultimapData.insert(make_pair('Q', 105));
MultimapData.insert(make_pair('Q', 250));
MultimapData.insert(make_pair('Q', 120));
MultimapData.insert(make_pair('Q', 102));
MultimapData.insert(make_pair('Q', 220));
pair<char, int> highest = *MultimapData.rbegin();
multimap<char, int> :: iterator Iter = MultimapData.begin();
do
{
cout << (*Iter).first << " => " << (*Iter).second << ' n';
} while ( MultimapData.value_comp()(*Iter++, highest) );
return 0;
}

A. 105
B. 250
C. 120
D. 102
E. 220
Answer» B. 250


Discussion

No Comment Found

Related MCQs