You are on page 1of 1

EXP3_4 #include<iostream.h> #include<conio.

h> class date { public: int hr,min,sec,nhr,nmin,nsec,day; void accept() { cout<<"Hours:\t"; cin>>hr; cout<<"Minutes:\t"; cin>>min; cout<<"Seconds:\t"; cin>>sec; } void display() { nsec=sec; sec=sec/60; nsec=nsec%60; min=sec+min; nmin=min; min=min/60; nmin=nmin%60; hr=min+hr; nhr=hr; hr=hr/24; nhr=nhr%24; int day=0; day=day+hr; cout<<"\nHours:\t"<<nhr; cout<<"\nMinutes:\t"<<nmin; cout<<"\nSeconds:\t"<<nsec; cout<<"\nDay:\t"<<day; } }; void main() { clrscr(); date t; t.accept(); t.display(); getch(); }

Page 1

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)