Nguyễn Văn Nhật
New member
What will be the output of the following C++ code?
A. Inner Catch
B. Outer Catch
C.
Inner Catch
Outer Catch
D. Error
Code:
#include <iostream>
using namespace std;
int main()
{
try
{
try
{
throw 20;
}
catch (int n)
{
cout << "Inner Catch\n";
}
}
catch (int x)
{
cout << "Outer Catch\n";
}
return 0;
}
B. Outer Catch
C.
Inner Catch
Outer Catch
D. Error