-
What is the output of this program?
#include <vector>
#include <iostream>
#include <typeinfo>
#include <stdexcept>
using namespace std;
int main()
{
vector<int> Data;
Data.push_back(56);
int k = Data[200];
try {
k = Data[0];
cout << k << endl;
}
catch (exception &excep)
{
cout << "Caught: " << excep.what( ) << endl;
cout << "Type: " << typeid( excep ).name( ) << endl;
}
catch (...)
{
cout << "Unknown exception: " << endl;
}
return 0;
}
-
- Compilation Error
- 56
- 200
- 100
- None of these
Correct Option: B
In this program, We are pushing the 10th element and printing it.