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)
{ min++;
sec-=60;

}


if(min>=60)
{ hr++;
min-=60;

}

}

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

No comments:

Post a Comment