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 / aashi

#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 ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction in oop with example?

1061


Why is abstraction needed?

978


to find out the minimum of two integer number of two different classes using friend function

2075


What is object and class in oops?

1004


What is pointer in oop?

969


What are functions in oop?

997


What is polymorphism give a real life example?

972


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

3173


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2564


What is overloading in oops?

1092


what is the sylabus for priliminaries?

2122


What is abstraction and encapsulation?

942


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

2071


program for insertion ,deletion,sorting in double link list

2636


What are main features of oop?

1080