-
What is the output of this program?
#include <iostream>
#include <map>
using namespace std;
int main ()
{
try {
map<char, int> Data;
map<char, int> :: iterator Iter;
Data['P'] = 55;
Data['Q'] = 105;
Data['R'] = 155;
Data['S'] = 205;
Iter = Data.find('Q');
Data.erase (Iter);
Data.erase (Data.find('S'));
cout << Data.find('P') -> second << '\n';
}
catch (...)
{
cout << "Unknown exception: " << endl;
}
return 0;
}
-
- 205
- 155
- 105
- 55
- Compilation Error
Correct Option: D
In this program ,We are finding the element a and printing it.