Problem link Click here
Read an integer value, which is the duration in seconds of a certain event in a factory, and inform it expressed in hours:minutes:seconds.
Input
The input file contains an integer N.
Output
Print the read time in the input file (seconds) converted in hours:minutes:seconds like the following example.
Input Sample | Output Sample |
556 | 0:9:16 |
1 | 0:0:1 |
140153 | 38:55:53 |
Solution....
#include<stdio.h>
int main()
{
int a,b,c,n;
scanf("%d",&n);
a=n/3600;
n=n%3600;
b=n/60;
c=n%60;
printf("%d:%d:%d\n",a,b,c);
return 0;
}
No comments:
Post a Comment