1.

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;
}

A. Compilation Error
B. 56
C. 200
D. 100
E. None of these
Answer» C. 200


Discussion

No Comment Found

Related MCQs