1.

What is the output of this program?
#include <iostream>
#include <string>
#include <typeinfo>
using namespace std;
int main( )
{
try
{
string str1("Interview");
string str2("Mania");
str1.append(str2, 6, 3);
cout << str1 << " " << endl;
}
catch (exception &e)
{
cout << "Caught: " << e.what() << endl;
cout << "Type: " << typeid(e).name() << endl;
};
return 0;
}

A. Compilation Error
B. Runtime Error
C. out_of_range
D. Garbage value
E. None of these
Answer» D. Garbage value


Discussion

No Comment Found

Related MCQs