Back To C++ User Defined Functions Index
//program to demonstrate single level inheritance, class colourbox is derived from class box in public access mode #include
#include
class box { int length; int breadth; int height; public: void bgetdata() { cout<<"\nenter length of box "; cin>>length; cout<<"\nenter breadth of box "; cin>>breadth; cout<<"\nenter height of box "; cin>>height; } void bshowdata() { cout<<"\nlength of box is "<
>colour; } void cshowdata() { bshowdata(); cout<<"\ncolour of box is "<