0% found this document useful (0 votes)
10 views1 page

Inherent Child

Uploaded by

mntsr80awdail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Inherent Child

Uploaded by

mntsr80awdail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<iostream>

using namespace std ;


const int nu=80;
class Stu {
private:
char stu_name[nu];
char field[nu];
public:
void input() {
cout<<"Enter student name: ";
cin>>stu_name;
cout<<"\n Enter student field: ";
cin>>field;
} void print() {
cout<<"\n student name="<<"\t"<<stu_name;
cout<<"\n student field="<<"\t"<<field;
}
};
class Degree:public Stu
{
private:
float d;
public:
void input()
{
Stu::input();

cout<<"\n Enter student degree=\t";


cin>>d;
} void print()
{
Stu::print();
cout<<"\n Student degree =\t"<<d;
}
};
int main()
{
Degree st;
st.input();
cout << "===================" << endl;
st.print();
};

You might also like