Home » C++ Programming » Questions and Answers » Question
  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('P', 150));
    MultimapData.insert(make_pair('Q', 250));
    MultimapData.insert(make_pair('Q', 300));
    MultimapData.insert(make_pair('R', 450));
    cout << MultimapData.size() << '\n';
    return 0;
    }
    1. 150
    2. 250
    3. 300
    4. 450
    5. 4
Correct Option: E

In this program, We are counting the number of elements in the map.



Your comments will be displayed only after manual approval.