Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable to store seconds
long long int sec;
cout<<"enter seconds:";
// read the seconds
cin>>sec;
// if seconds is in between 60 and 3600
if(sec>=60&& sec<3600)
{
// find the minutes
int min=sec/60;
cout<<"there are "<<min<<" minutes in "<<sec<<" seconds."<<endl;
}
// if seconds is in between 3600 and 86400
else if(sec>=3600&&sec<86400)
{
// find the hours
int hours=sec/3600;
cout<<"there are "<<hours<<" hours in "<<sec<<" seconds."<<endl;
}
// if seconds is greater than 86400
else if(sec>86400)
{
// find the days
int days=sec/86400;
cout<<"there are "<<days<<" days in "<<sec<<" seconds."<<endl;
}
return 0;
}
Step-by-step explanation:
Read the seconds from user.If the seconds is in between 60 and 3600 then find the minutes by dividing seconds with 60 and print it.If seconds if in between 3600 and 86400 then find the hours by dividing second with 3600 and print it. If the seconds is greater than 86400 then find the days by dividing it with 86400 and print it.
Output:
enter seconds:65
there are 1 minutes in 65 seconds.
enter seconds:3700
there are 1 hours in 3700 seconds.
enter seconds:900000
there are 10 days in 900000 seconds.