STUDENT DETAILS

#include
#include
class student
{
protected:
int rollno;
char name[30];
public:
void getdata()
{
cout<<"Enter the studend name:"< cin>>name;
cout<<"Enter the roll no:"<<"\n";
cin>>rollno;
}
void putdata()
{
cout<<"Name:"< cout<<"rollno:"<}
};
class test:public student
{
protected:
int l,m1,m2,m3;
public:
void getmarks()
{
cout<<"Enter the marks:"< cin>>m1>>m2>>m3;
}
void putmarks()
{
cout<<"Mark1:"< cout<<"Mark2:"< cout<<"mark3:"< }
};
class result:public test
{
protected:
int total;
float avg;
public:
void display()
{
total=m1+m2+m3;
avg=total/3;
cout<<"\n\n\t\tStudent details"< cout<<"Name ="< cout<<"rollno ="< cout<<"m1 ="< cout<<"m2 ="< cout<<"m3 ="< cout<<"total ="< cout<<"average="< }
};
void main()
{
clrscr();
result r;
r.getdata();
r.getmarks();
r.display();
getch();
}

Comments