C++ | Exception Handling | Question 11
What happens in C++ when an exception is thrown and not caught anywhere like following program.
#include <iostream> using namespace std; int fun() throw (int) { throw 10; } int main() { fun(); return 0; } |
chevron_right
filter_none
(A) Compiler error
(B) Abnormal program termination
(C) Program doesn’t print anything and terminates normally
(D) None of the above
Answer: (B)
Explanation: When an exception is thrown and not caught, the program terminates abnormally.
Quiz of this Question
Recommended Posts:
- C++ | Exception Handling | Question 6
- C++ | Exception Handling | Question 7
- C++ | Exception Handling | Question 8
- C++ | Exception Handling | Question 9
- C++ | Exception Handling | Question 10
- C++ | Exception Handling | Question 5
- C++ | Exception Handling | Question 4
- C++ | Exception Handling | Question 12
- C++ | Exception Handling | Question 3
- C++ | Exception Handling | Question 2
- C++ | Exception Handling | Question 1
- Java | Exception Handling | Question 2
- Java | Exception Handling | Question 3
- Java | Exception Handling | Question 4
- Java | Exception Handling | Question 6



