E9MLTINH - } }; } class test:public st,private marks {...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # class st { protected: char n[25]; int rn; public: void getinfo() { cout<<"Enter the values\n"; cin>>n>>rn; } void showinfo() { cout<<n<<rn<<endl; } }; } class marks { protected: int m1,m2; public: void get() { cout<<"Enter the values\n"; cin>>m1>>m2; } void disp() { cout<<m1<<m2<<endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } }; } class test:public st,private marks { private: float avg; public: void cal() { get(); avg=(m1+m2)/2; } void show() { disp(); cout&lt;&lt;&quot;Average&quot;&lt;&lt;avg; } }; } void main() { clrscr(); test t; t.getinfo(); t.cal(); t.showinfo(); t.show(); getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Fall '06 term at University of Mumbai.

Page1 / 2

E9MLTINH - } }; } class test:public st,private marks {...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online