Answers for "number of hours, minutes, and seconds given the number of seconds."

C
0

number of hours, minutes, and seconds given the number of seconds.

#include <stdio.h>

void main(void)
{
int time, hours, minutes, seconds;
printf("Input seconds: ");
scanf("%d", &time);

hours = time / 3600;
minutes = (time % 3600) / 60;
seconds = ((time % 3600) % 60);

printf("\nThere are:");
printf("\nH:M:S - %d:%d:%d", hours, minutes, seconds);
}
Posted by: Guest on April-28-2022

Code answers related to "number of hours, minutes, and seconds given the number of seconds."

Code answers related to "C"

Browse Popular Code Answers by Language