Surya was used to wear a smartwatch when he was in the Treadmill and during Cycling. Surya’s Smart watch displays the total workout time in seconds.
But Surya would like to know the time he spent for workout in H:M:S format.
Can you help surya in knowing the time he spent on workout in the prescribed format?
Input:
7845
Output:
2H:10M:45S
#include <stdio.h> int main() { int sec,h,m,s; scanf("%d",&sec); h=sec/3600; m=(sec-(h*3600))/60; s=(sec-(h*3600)-m*60); printf("%dH:%dM:%dS",h,m,s); return 0; }
INPUT_1:
7845
OUTPUT:
2H:10M:45S
INPUT_2:
1000
OUTPUT:
0H:16M:40S
INPUT_3:
10000
OUTPUT:
2H:46M:40S
INPUT_4:
9871
OUTPUT:
2H:44M:31S
INPUT_5:
6300
OUTPUT:
1H:45M:0S
INPUT_6:
3700
OUTPUT:
1H:1M:40S
ILLUSTRATION
Morae Q!
- Convert seconds to hours – HMS format.
- Find out the tax amount of the bill with tip for the meal.
- Find the area of the pyramid.
- Find the area of triangle using heron’s formula.
- Find the interest and amount resided in the bank.
- Convert the travel days to years and months.
- Find the first three powers of N number.
- Compute the height from feet and inches to centimetres.
- Calculate the amount of interest earned in the bank.
- Find the ways they can choose the sequence of dummy statues.
- Find the Lapindrome strings.
- Classify the salary of a person.
- Find the day on providing the week number.
- Find the least number of marble stones needed to pave the square mall.
- Find the number of steps on chessboard performed to satisfy a condition.
- Find the time, hours and minutes the train was delayed.
- Find the quantity of food packets shared and available.
- Compute all Arithmetic Operations.
- Find the amount to pay for the electricity bill.
- Find the sum of numbers with three values after decimal point.