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
What is abstraction in oop with example?
Why is abstraction needed?
to find out the minimum of two integer number of two different classes using friend function
What is object and class in oops?
What is pointer in oop?
What are functions in oop?
What is polymorphism give a real life example?
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
#include
What is overloading in oops?
what is the sylabus for priliminaries?
What is abstraction and encapsulation?
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).
program for insertion ,deletion,sorting in double link list
What are main features of oop?