Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(int argc, const int * argv[])
- {
- int allSec, days, hours, min, sec;
- const int secInDay = 86400;
- cout << " Convert seconds into format days.hours.min.sec. \n ";
- cout << " Enter the quantity of seconds you'd like to be coverted \n ";
- cin >> allSec;
- days = allSec / 60 / 60 / 24;
- hours = allSec % secInDay / 3600;
- min = allSec % secInDay % 3600 / 60;
- sec = allSec % secInDay % 3600 % 60;
- cout << " Your seconds are:" << days << " Day(s), " << hours << " Hour(s), " << min << " min, " << sec << " Seconds. " << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement