#include<iostream.h>
#include<conio.h>
#include<time.h>
void main()
{
clrscr();
time_t t,t1;
t=time(NULL);
cout<<"The current time is:"<<ctime(&t);
t1=t;
cout<<"\nenter the seconds:";
int sec;
cin>>sec;
t1-=sec;
t+=sec;
cout<<"\nthe incremented time is:"<<ctime(&t);
cout<<"\nthe decremented time is:"<<ctime(&t1);
getch();
}
No comments:
Post a Comment