Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

difine hierarchical inheritance.

Answer Posted / manoj shukla

#include<constream.h>
#include<iostream.h>
class A
{
protected:
char name[20];
};
class B:public A
{
protected:
int age;
};
class C:public A
{
char adress[100];
void getdata()
{
cout<<"enter the name:-";
cin>>name;
cout<<"enter the age:-";
cin>>age;
cout<<"enter the adress:-";
cin>>adress;
}
void show()
{
cout<<"name"<<name<<"\n\n age"<<age<<"\n\nadress:-"<<adress;
getdata();
}
void main()
{
clrscr()
C K;
K.show();
getch();
}

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is abstract thinking intelligence?

1047


What is object in oop?

1111


What does it mean when someone says I oop?

1062


How do you explain polymorphism?

1072


What is the example of polymorphism?

1122


what are the different types of qualifier in java?

2272


Why is destructor used?

1019


What is a function in oop?

1082


Where You Can Use Interface in your Project

1886


What is polymorphism give a real life example?

1032


What makes a language oop?

1054


Can we create object of abstract class?

1088


Why is abstraction needed?

1033


What is difference between data abstraction and encapsulation?

1077


what are the ways in which a constructors can be called?

2128