Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C++ | Exception Handling | Question 3

  • Last Updated : 28 Jun, 2021

What should be put in a try block?


1. Statements that might cause exceptions
2. Statements that should be skipped in case of an exception 

(A) Only 1
(B) Only 2
(C) Both 1 and 2


Answer: (C)

Explanation: The statements which may cause problems are put in try block. Also, the statements which should not be executed after a problem accursed, are put in try block. Note that once an exception is caught, the control goes to the next line after the catch block.

Quiz of this Question

Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!