Answers for "Write a program that inputs time in seconds and converts it into hh-mm-ss format"

C++
0

Write a program that inputs time in seconds and converts it into hh-mm-ss format

#include<iostream>
using namespace std;
int main()
{
 int t,h,m,s;
 cout<<"\t Changing Time Format "<<endl;
 cout<<"\n";
 cout<<"Enter time (in Seconds) "<<endl;
 cin>>t;
 h=t/3600;
 t=t%3600;
 m=t/60;
 t=t%60;
 s=t;
 cout<<"\n";
 cout<<"Time in HH:MM:SS is "<<h<<":"<<m<<":"<<s<<endl;
}
Posted by: Guest on December-17-2020

Code answers related to "Write a program that inputs time in seconds and converts it into hh-mm-ss format"

Browse Popular Code Answers by Language