Seconds into Hours and Minutes
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cout << "Enter the total number of Seconds: "; cin >> a;
b = a / 3600;
c = (a % 3600) / 60;
d = a % 60;
cout << "\nHours: " <<b<< "\nMinutes: " <<c<< "\n Seconds: " <<d;
return 0;
}
______________________________
Hours into and weeks
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
cout << "Enter the total number of Hours: ";
cin >> a;
b = a / 168;
c = (a % 168) / 24;
d= a % 24;
cout << "Weeks: " << b << "\nDays: " << c << "\nHours: " <<d<< endl;
return 0;
}