Qtr No. 213, New Town Yehlanka
Indore 454775, India
| Predict the output for the following program class LivingThing { public: LivingThing(){ cout << "Constructor of LivingThing Class" << endl; } ~LivingThing(){ cout << "Destructor of LivingThing Class" << endl; } }; class Animal : public LivingThing { public: Animal(){ cout << "Constructor of Animal Class" << endl; } ~Animal(){ cout << "Destructor of Animal Class" << endl; } }; class Reptile : public LivingThing { public: Reptile(){ cout << "Constructor of Reptile Class" << endl; } ~Reptile(){ cout << "Destructor of Reptile Class" << endl; } }; class Snake : public Animal, public Reptile { public: Snake(){ cout << "Constructor of Snake Class" << endl; } ~Snake(){ cout << "Destructor of Snake Class" << endl; } }; int main() { Snake* s = new Snake; } |
To get all Infosys Certified CPP Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee