Write a program of single inheritance


 

/* Write a program of single inheritance*/

#include<iostream.h>

#include<conio.h>

class a

{

public:

void dis()

{

cout<<“dis”;

}};

class b:public a

{

public:

void show()

{

cout<<“show”;

}};

void main()

{

clrscr();

class b a1;

a1.dis();

cout<<endl;

a1.show();

getch();

}

/* ouput:

dis

show*/

Related Posts

Comments are closed.