adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <map>
    using namespace std;
    int main ()
    {
        map<char, int> mymap;
        map<char, int> :: iterator it;
        mymap['b'] = 100;
        mymap['a'] = 200;
        mymap['c'] = 300;
        for (map<char, int> :: iterator it = mymap.begin(); it != mymap.end(); ++it)
            cout << it -> first << " => " << it -> second << '\n';
        return 0;
    }

a.

a => 200 c => 300

b.

a => 200 b => 100

c.

a => 200 b => 100 c => 300

d.

None of the mentioned

Answer: (c).a => 200 b => 100 c => 300

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?