Skip to content
Related Articles

Related Articles

C++ | Exception Handling | Question 6

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021

#include <iostream>
using namespace std;
int main()
       throw 10;
    catch (...)
        cout << "default exception\n";
    catch (int param)
        cout << "int exception\n";
    return 0;

(A) default exception
(B) int exception
(C) Compiler Error

Answer: (C)

Explanation: It is compiler error to put catch all block before any other catch. The catch(…) must be the last catch block.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!