Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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("
There are:");
printf("
H:M:S - %d:%d:%d", hours, minutes, seconds);
}
 
PREVIOUS NEXT
Tagged: #number #seconds #number
ADD COMMENT
Topic
Name
5+5 =