adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    int main () 
    {
        try
        {
            throw 20;
        }
        catch (int e)
        {
            cout << "An exception occurred " << e << endl;
        }
        return 0;
    }

a.

20

b.

An exception occurred

c.

Error

d.

An exception occurred 20

Answer: (d).An exception occurred 20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?