Thursday 3 July 2014

Program to display the time corresponding to a integer number




// Time
#include<iostream.h>
#include<conio.h>
void main ()
{
int time, hr, mts, sec;
clrscr();
cout<<"Enter the time in seconds:";
cin>>time;
hr=time/3600;
time=time%3600;
mts=time/60;
sec=time%60;
cout<<"Time is:"<<hr<<" Hrs:"<<mts<<" Mins: "<<sec<<" Secs";
getch();
}

No comments:

Post a Comment