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
Which language is not a true object oriented programming language?
What is overloading and its types?
What is polymorphism what is it for and how is it used?
hi all..i want to know oops concepts clearly can any1 explain??
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
Get me an image implementation program.
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
What is object in oop with example?
What does oop mean in snapchat?
What is the main purpose of inheritance law?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What exactly is polymorphism?
What is balance factor?
What is encapsulation process?
How can you overcome the diamond problem in inheritance?