OBJASARG - time time :: add(time t1) { time t; t.h=h+t1.h;...

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 time { int h,m; public: void get(); void put(); time add(time); }; } void time::get() { cout<<"Enter hrs & min"; cin>>h>>m; } void time::put() { cout<<"\nhrs "<<h; cout<<"\nmin "<<m; }
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: time time :: add(time t1) { time t; t.h=h+t1.h; t.m=m+t1.m; return (t); } void main() { clrscr (); time t,t1,t2; t1.get(); t2.get(); t1.put(); t2.put(); t=t1.add(t2); t.put(); 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