Skip to main content

Exception Handling In C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Exception Handling In C Plus Plus — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

How do you specify that a function may throw an exception in C++?

Question 2 of 40
★ FPSC ★ PPSC

What is exception handling in C++?

Question 3 of 40
★ FPSC ★ PPSC

Which keyword is used to throw an exception in C++?

Question 4 of 40
★ FPSC ★ PPSC

What is the purpose of the 'try' block in exception handling in C++?

Question 5 of 40
★ FPSC ★ PPSC

Which of the following is not a standard exception class in C++?

Question 6 of 40
★ FPSC ★ PPSC

What is the purpose of the 'catch' block in exception handling in C++?

Question 7 of 40
★ FPSC ★ PPSC

Which of the following is not a part of the exception handling mechanism in C++?

Question 8 of 40
★ FPSC ★ PPSC

What does the 'std::exception' class represent in C++ exception handling?

Question 9 of 40
★ FPSC ★ PPSC

How do you catch all exceptions in C++?

Question 10 of 40
★ FPSC ★ PPSC

Which function is used to retrieve the description of the exception in C++?

Question 11 of 40
★ FPSC ★ PPSC

What happens if an exception is thrown but not caught in C++?

Question 12 of 40
★ FPSC ★ PPSC

Which of the following statements is true about the 'finally' block in C++ exception handling?

Question 13 of 40
★ FPSC ★ PPSC

What is the purpose of re-throwing an exception in C++?

Question 14 of 40
★ FPSC ★ PPSC

Which header file is necessary for exception handling in C++?

Question 15 of 40
★ FPSC ★ PPSC

What is the function of the 'assert' macro in C++?

Question 16 of 40
★ FPSC ★ PPSC

How do you define your own exception class in C++?

Question 17 of 40
★ FPSC ★ PPSC

What is the default behavior of an uncaught exception in C++?

Question 18 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::runtime_error' class in C++ exception handling?

Question 19 of 40
★ FPSC ★ PPSC

Which of the following is true about the 'noexcept' specifier in C++?

Question 20 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::bad_alloc' class in C++ exception handling?

Question 21 of 40
★ FPSC ★ PPSC

What happens if an exception is thrown inside a 'catch' block in C++?

Question 22 of 40
★ FPSC ★ PPSC

How do you re-throw the current exception in C++?

Question 23 of 40
★ FPSC ★ PPSC

Which of the following statements about exception handling in C++ is correct?

Question 24 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::exception_ptr' class in C++ exception handling?

Question 25 of 40
★ FPSC ★ PPSC

How do you catch multiple exceptions of different types in C++?

Question 26 of 40
★ FPSC ★ PPSC

Which keyword is used to define a custom exception class in C++?

Question 27 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::terminate' function in C++?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of the 'nothrow' parameter in the 'new' operator in C++?

Question 29 of 40
★ FPSC ★ PPSC

How do you handle exceptions thrown from constructor initialization lists in C++?

Question 30 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::bad_function_call' class in C++ exception handling?

Question 31 of 40
★ FPSC ★ PPSC

Which statement about the 'finally' block in C++ exception handling is true?

Question 32 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::nested_exception' class in C++ exception handling?

Question 33 of 40
★ FPSC ★ PPSC

How do you catch an exception by reference in C++?

Question 34 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::logic_error' class in C++ exception handling?

Question 35 of 40
★ FPSC ★ PPSC

What happens if an exception is thrown inside a destructor in C++?

Question 36 of 40
★ FPSC ★ PPSC

Which keyword is used to specify that a function will not throw any exceptions in C++?

Question 37 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::uncaught_exception' function in C++?

Question 38 of 40
★ FPSC ★ PPSC

Which standard header file is required for exception handling in C++?

Question 39 of 40
★ FPSC ★ PPSC

How do you specify that a function will throw no exceptions in C++?

Question 40 of 40
★ FPSC ★ PPSC

What is the purpose of the 'std::exception_ptr::rethrow' function in C++?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →