InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Output of following program#include<iostream>using namespace std;class Base {};class Derived: public Base {};int main(){Derived d;try {throw d;}catch(Base b) {cout<<"Caught Base Exception";}catch(Derived d) {cout<<"Caught Derived Exception";}return 0;}(A) Caught Derived Exception(B) Caught Base Exception(C) Compiler Error |
| Answer» | |
| 2. |
#include <iostream>using namespace std;int main(){try{throw 'a';}catch (int param){cout << "int exception\n";}catch (...){cout << "default exception\n";}cout << "After Exception";return 0;}(A)default exceptionAfter Exception(B)int exceptionAfter Exception(C)int exception(D)default exception |
| Answer» | |