C-study/02-1/4/4.c

15 lines
242 B
C
Raw Permalink Normal View History

2021-09-29 07:15:39 +00:00
#include<stdio.h>
int main()
{
int a,h=0,m=0,s=0;
printf("Please input time in seconds:");
scanf("%d",&a);
h = a / 3600;
a = a % 3600;
m = a / 60;
s = a % 60;
printf("\nHours: %d\nMinutes: %d\nSeconds: %d",h,m,s);
return 0;
}