ADOBOFCL - void time add(time t1,time t2 h=t1.h t2.h m=t1.m...

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> //ADD 2 OBJECTS OF CLASSESI // class time { int h,m; public: void in(int,int); void display(); void add (time,time); }; void time::in(int a,int b) { h=a; m=b; } void time::display() { cout<<"HRS "<<h<<"MIN "<<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: } void time :: add(time t1,time t2) { h=t1.h+t2.h; m=t1.m+t2.m; } void main() { clrscr(); time a1,a2,a3;,40);,10); a3.add(a1,a2); a3.display(); getch(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online