xxxxxxxxxx
#include<iostream>
#include<conio.h>
#include<iomanip>
using namespace std;
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int seconds,minutes,hours;
cin>>seconds;
minutes=seconds/60;
hours=minutes/60;
cout<<seconds<<" Seconds is Equivalent to "<<int(hours)
<<" Hours, "<<int(minutes%60)<<" Minutes and "<<int (seconds%60)
<<" Seconds."<<endl;
return 0;
}
xxxxxxxxxx
int seconds, hours, minutes;
cin >> seconds;
minutes = seconds / 60;
hours = minutes / 60;
cout << seconds << " seconds is equivalent to " << int(hours) << " hours " << int(minutes%60)
<< " minutes " << int(seconds%60) << " seconds.";
xxxxxxxxxx
#include<iostream>
using namespace std;
int main (){
int hours, minutes, seconds, hours_sec, minuted_sec, total;
cout << "enter the time in hours, minutes, and seconds."<<endl;
cin >> hours >> minutes >> seconds;
cout << hours << ":" << minutes << ":" << seconds << endl;
hours_sec = hours*3600;
minuted_sec = minutes*60;
total = hours_sec + minuted_sec + seconds;
cout << "time in seconds:" << total << " seconds";
return 0;
}
xxxxxxxxxx
#include<iostream>
using namespace std;
int main(){
int total_seconds, qoutient, seconds, hours, minutes ;
cout << "Enter the time in seconds:" ;
cin >> total_seconds;
qoutient=total_seconds/60;
seconds =total_seconds%60;
hours = qoutient/60;
minutes = qoutient%60;
cout << hours << ":" << minutes << ":" << seconds;
return 0;
}