#include #include class time {private:int h; int m; int s; public:time() {h=0;m=0;s=0;} time(int a,int b,int c) {h=a;m=b;s=c;} void getdata(); void showdata() {cout<<"\n the time -> "<60) {t=s/60; s=s-(60*t); m=m+t; } t=0; if(m>60) {t=m/60; m=m-(60*t); h=h+t; } } }t1,t2,t3; void time :: getdata() {int c=0,t=0; clrscr(); while(c==0) {cout<<"\n enter the parameters of time \n"; cout<<"\n enter seconds: "; cin>>s; if(s<0) {cout<<"\n please enter the positive value \n"; } else {if(s>60) {t=s/60; s=s-(t*60); } c=1; } } c=1; while(c==1) {cout<<"\n enter minutes: "; cin>>m; if(m<0) {cout<<"\n you have entered wrong value enter again"; } else {m=m+t; if(m>60) {t=m/60; m=m-(t*60); } else {t=0;} c=0; } } c=0; while(c==0) {cout<<"\n enter hour: "; cin>>h; if(h<0) {cout<<"\n sorry you have entered wrong value enter again"; } else {h=h+t; c=1; } } } void main() {int n,i; clrscr(); t1.getdata(); t1.showdata(); t2.getdata(); t2.showdata(); cout<<" sum of"; t3.sum(t1,t2); t3.showdata(); getch(); }