0

What is the output of the following C++ program?

[gamipress_button type=”submit”  label=”Run Code Online” onclick=”window.open(‘https://coderseditor.com’,’_blank’)”]

—-

#include <iostream>
using namespace std;
 class A
{
public:
 void print() { cout << "A::print()"; }
};
 class B : private A
{
public:
 void print() { cout << "B::print()"; }
};
 class C : public B
{
public:
 void print() { A::print(); }
};
 int main()
{
 C b;
 b.print();
}

Studently Answered question October 10, 2022