?
What will be the output of the following C++ code?
What will be the output of the following C++ code?
#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;
}
#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;
}
Join the Discussion
Login to post a comment or share your explanation.
Login