Menu

Custom Search

C++ lab Program

#include
#include
class time
{
int hr,min,sec;

public:
time()
{
hr=0;
min=0;
sec=0;
cout<<"Default constructor:"<=60)
{ count=1;
sec=60-sec;

}
min=t1.min+t2.min+count;
count=0;
if(min>=60)
{ count=1;
min=60-min;

}
hr=t1.hr+t2.hr+count;
}

void main()
{
clrscr();
time t1(1,2,3),t2(4,50,6);
time *ptr;
ptr=new time;
ptr->add(t1,t2);
t1.display();
t2.display();
ptr->display();
delete ptr;
getch();
}

No comments:

Post a Comment