Predict the output of following program.


			  		

Loading

โœช Choose the correct option.

Predict the output of following program.

#include 
using namespace std;
class A
{
protected:
int x;
public:
A() {x = 0;}
friend void show();
};

class B: public A
{
public:
B() : y (0) {}
private:
int y;
};

void show()
{
A a;
B b;
cout << "The default value of A::x = " << a.x << " ";
cout << "The default value of B::y = " << b.y;
}

A. The default value of A::x = 0 The default value of B::y = 0
B. Compiler Dependent
C. Compiler Error in show() because y is private in class b
D. Compiler Error in show() because x is protected in class A