Write a C++ program to sum hours and minutes of two objects into a third object by passing object as an argument to the function
#include #include class abc { private: int hr,min; public: abc() { hr=min=0; } abc(int f,int i) { hr=f; min=i; } void getdata() { cout<<"\n"<<"Enter the time in hour: "; cin>>hr; cout<<"\n"<<"Enter the time in min: "; cin>>min; } void show() { cout<<"\n"<<"Total time is: "<
=60) { hr++; min-=60; } } void main() { abc h1(6,40); abc h2,h3; clrscr(); h2.getdata(); h3.add(h1,h2); h3.show(); getch(); } OUTPUT Enter the time in hour :2 Enter the time in minute:30 Total time is :9 hour 10 min