11
Loading subject content…
Loading subject content…
Loading practice questions…
What will be the output of the program?
#include <iostream>
#include <string>
#include <exception>
using namespace std;
int main() {
try {
throw string("oops");
} catch (const exception &e) {
cout << "std" << endl;
} catch (const string &s) {
cout << s << endl;
}
return 0;
}What will be the output of the program?
#include <iostream>
using namespace std;
int main() {
try {
try { throw 1; }
catch (int) { cout << "inner "; throw; }
} catch (int) {
cout << "outer";
}
cout << endl;
return 0;
}