Question OOP-EXC-0045
MediumWhat is the output of this code?
#include <iostream>
using namespace std;
#include <stdexcept>
int main() {
try {
try {
throw runtime_error("inner");
} catch (const runtime_error &e) {
cout << "1";
throw;
}
} catch (const exception &e) {
cout << "2" << e.what();
}
}
- A.
1
- B.
12inner
- C.
2inner
- D.
1inner
Sign up free to see the answer and a step-by-step explanation.