E8SMPINH - { cout<<"\na=

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # class B { private: int a; public: int b; void get_ab() { a=5; b=10; } int get_a() { return a; } void show_a() { cout<<endl<<a; } }; } class D:public B { int c; public: void mul() { c=b*get_a(); } void disp()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { cout&lt;&lt;&quot;\na= &quot;&lt;&lt;get_a(); cout&lt;&lt;&quot;\nb= &quot;&lt;&lt;b; cout&lt;&lt;&quot;\nc= &quot;&lt;&lt;c; } }; } void main() { clrscr(); D d; d.get_ab(); d.mul(); d.show_a(); d.disp(); d.b=20; d.mul(); d.disp(); getch(); }...
View Full Document

Ask a homework question - tutors are online