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
Is abstract thinking intelligence?
What is object in oop?
What does it mean when someone says I oop?
How do you explain polymorphism?
What is the example of polymorphism?
what are the different types of qualifier in java?
Why is destructor used?
What is a function in oop?
Where You Can Use Interface in your Project
What is polymorphism give a real life example?
What makes a language oop?
Can we create object of abstract class?
Why is abstraction needed?
What is difference between data abstraction and encapsulation?
what are the ways in which a constructors can be called?