LogiQuest
Back to Exception Handling
12

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;
}
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.