Friday, 23 April 2021

Inheritance in C++ Qus - 3

 #include<iostream.h>

#include<conio.h>

class A

{

protected:

A()

{

cout<<"C-A"<<endl;

}

};

class B:A

{

public:

B()

{

cout<<"C-B"<<endl;

}

};


int main()

{

clrscr();

B ob;

//A ob1;

getch();

return 0;


}

No comments:

Post a Comment