Home » C++ Programming » Exception Handling » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
    try
    {
    throw 13;
    }
    catch (int ex)
    {
    cout << "Exception number: " << ex << endl;
    return 0;
    }
    cout << "No any Exception..." << endl;
    return 0;
    }
    1. Exception number: 13
    2. 13
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: A

If we caught a integer value means, there will be an exception, if it is not a integer, there will not be a exception.



Your comments will be displayed only after manual approval.