Spot the possible errors in the following program

Line - 1 class Base {
Line - 2 void display(){
Line - 3 cout << "Base class - display";
Line - 4 }
Line - 5 };
Line - 6 class Derived : protected Base{
Line - 7 public:
Line - 8 void display(){
Line - 9 cout << "Derived class - display";
Line - 10 }
Line - 11 };
Line - 12 int main() {
Line - 13 Base* b = new Derived;
Line - 14 b.display();
Line - 15 return 0;
Line - 16 }

Line - 2, 6, 13, 14
Line - 2, 6, 14
Line - 2, 13, 14
Line - 6, 13, 14
Verified Answer
Correct Option - b

To get all Infosys Certified CPP Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram