E8SMPINH - cout<<"\na="<<get_a...

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<<"\na= "<<get_a(); cout<<"\nb= "<<b; cout<<"\nc= "<<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

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.

Ask a homework question - tutors are online