Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PRACTICAL NO-11

//NAME: BHOYE BHUSHAN

#include<iostream.h>
#include<conio.h>
class person
{
protected:
char name[10];
int age;
char address[10];
};
class student:public person
{
private:
int rollno;
public:
void getdata()
{
cout<<"Enter Name: ";
cin>>name;
cout<<"Enter Age: ";
cin>>age;
cout<<"Enter Address: ";
cin>>address;
cout<<"Enter
Roll Number: ";
cin>>rollno;
}
void showdata()
{
cout<<endl<<"DISPLAY";
cout<<endl<<"Name: "<<name<<endl;
cout<<"Age: "<<age<<endl;
cout<<"Address: "<<address<<endl;
cout<<"Roll Number: "<<rollno<<endl;
} };
int main()
{
clrscr();
student s;
s.getdata();
s.showdata();
getch();
}

*************** OUTPUT ***************

You might also like