Open In App
Related Articles

Algorithms Quiz | Sudo Placement [1.6] | Question 3

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
What is the output of following code :
#include <iostream>
using namespace std;
   
int main()
{
    try  {
       throw 10;
    }
    catch (char *excp)  {
        cout << "Caught " << excp;
    }
    catch (...)  {
        cout << "Default Exception\n";
    }
    return 0;
}

                    
(A) Compiler Error (B) Caught Default Exception (C) Caught Integer Exception (D) Default Exception

Answer: (D)

Explanation: Refer : https://www.geeksforgeeks.org/exception-handling-c/

Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 16 Aug, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads