#include <iostream.h>
#include <conio.h>
void main()
{
int sec, s, m, h;
cout<< "\n Enter time in seconds :";
cin >> sec;
h = sec/3600; //hours
sec = sec%3600; // remaining seconds
m = sec/60; // minutes
s = sec%60; // remaining seconds
cout << "\n HH-MM-SS : " << h << ":" << m << ":" << s;
getch();
}
No comments:
Post a Comment