adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int age = 0;
        try 
        {
            if (age < 0) 
            {
                throw "Positive Number Required";
            }
            cout << age;
        }
        catch(const char *Message)
        {
            cout << "Error: " << Message;
        }
        return 0;
    }

a.

0

b.

error:Positive Number Required

c.

compile time error

d.

none of the mentioned

Answer: (a).0

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?