C++ Programming MCQs & Mock Tests

Topic-wise bilingual C++ questions for college exams, GATE, interviews, and competitive tests.

Q1 · OOP, Inheritance & PolymorphismIntermediate

Why should a polymorphic base class declare a virtual destructor?

class Base {
public:
    virtual ~Base() = default;
};
Q2 · OOP, Inheritance & PolymorphismIntermediate

Which keyword solves the Diamond Problem in C++ multiple inheritance?