Open In App
Related Articles

C++ | Exception Handling | Question 3

Improve Article
Save Article
Like Article

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 


Only 1


Only 2


Both 1 and 2

Answer: (C)


The statements which may cause problems are put in try block. Also, the statements which should not be executed after a problem occurred, 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
Please comment below if you find anything wrong in the above post

Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads