E16FRDFN - } void x::output() {...

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 x; class a { float m,cm; public: void get(); void display(); friend a add(a,x); }; } class x { float f,i; public: void input(); void output(); friend a add (a,x); }; } void a::get() { cout<<"\nEnter dist in m & cm"; cin>>m>>cm; } void x::input() { cout<<"\nEnter dist in feet & inches "; cin>>f>>i; } void a::display() { cout<<"\nDist in m & cm "<
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: } void x::output() { cout&lt;&lt;&quot;\nDist in feet &amp; inches &quot;&lt;&lt;f&lt;&lt;&quot;g &quot;&lt;&lt;i; } a add (a p, x q) { a t; t.m=(q.f*12*2.54)+p.m; t.cm=(q.i*2.54)+p.cm; return (t); } void main() { clrscr(); a a1,a2; x x1; a1.get(); x1.input(); a2=add(a1,x1); a1.display(); x1.output(); a2.display(); 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

E16FRDFN - } void x::output() {...

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