-
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;
}
-
- Compilation Error
- Runtime Error
- out_of_range
- Garbage value
- None of these
Correct Option: C
out_of_range