-
What is the output of this program?
#include <iostream>
#include <map>
using namespace std;
int main ()
{
map<char, int> MapData;
map<char, int> :: iterator Iter;
MapData['P'] = 250;
MapData['Q'] = 150;
MapData['R'] = 350;
for (map<char, int> :: iterator Iter = MapData.begin(); Iter != MapData.end(); ++Iter)
cout << Iter -> first << " => " << Iter -> second << '\n';
return 0;
}
-
- P => 250
Q => 150
R => 350 - Q => 150
P => 250
R => 350 - R => 350
P => 250
Q => 150 - All of above
- None of these
- P => 250
Correct Option: A
In this program, We used the map template and the we used the begin operation and then we are printing the elements.