LogiQuest
Back to Exception Handling
1

What will be the output of the program?

#include <iostream>
using namespace std;

int main() {
    try {
        throw 42;
    } catch (int e) {
        cout << "int " << e << endl;
    } catch (...) {
        cout << "other" << endl;
    }
    return 0;
}
Easy

Discussion (0)

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

Log in to join the discussion.