Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming Quiz 209 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
class BixBase
{
public:
BixBase()
{
cout<< "Base OK. "; } }; class BixDerived: public BixBase { public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; } }; int main() { BixBase objB; BixDerived objD; objD.~BixDerived(); return 0; }

[A].Base OK. Derived OK. Derived DEL.
[B].Base OK. Base OK. Derived OK. Derived DEL.
[C].Base OK. Derived OK. Derived DEL. Derived DEL.
[D].Base OK. Base OK. Derived OK. Derived DEL. Derived DEL. 

Answer: Option D