1. What is exception handling in C++? A. A method to handle errors during runtime B. A method to handle errors during compile time C. A method to handle errors during linking D. A method to handle errors during execution Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. Which keyword is used to throw an exception in C++? A. raise B. throw C. catch D. try Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
3. What is the purpose of the 'try' block in exception handling in C++? A. To catch exceptions B. To throw exceptions C. To define the block of code that may generate exceptions D. To handle exceptions Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. Which of the following is not a standard exception class in C++? A. IOException B. std::exception C. std::runtime_error D. std::out_of_range Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
5. What is the purpose of the 'catch' block in exception handling in C++? A. To throw exceptions B. To define the block of code that may generate exceptions C. To catch and handle exceptions D. To handle errors during compile time Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
6. Which of the following is not a part of the exception handling mechanism in C++? A. try block B. throw keyword C. assert function D. catch block Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
7. What does the 'std::exception' class represent in C++ exception handling? A. It is a base class for all standard C++ exceptions B. It is used to handle file exceptions C. It is used to handle memory exceptions D. It is used to handle arithmetic exceptions Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. How do you catch all exceptions in C++? A. catch (...) B. catch (Exception e) C. catch (AllExceptions) D. catch (std::exception) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
9. Which function is used to retrieve the description of the exception in C++? A. get_message() B. what() C. catch_msg() D. exception_desc() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
10. What happens if an exception is thrown but not caught in C++? A. The program terminates abruptly B. The program continues execution normally C. The program waits indefinitely D. The exception is automatically caught Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board