Enter the number of seconds and return Hours, Minutes, Seconds.
Count time in C.
Date Created:Thursday March 01st, 2007 04:34 PM
Date Modified:Saturday August 02nd, 2008 01:59 PM
#include <stdio.h>
int main()
{
int hours;
int minutes;
int seconds;
printf("Enter in the number of seconds:\n");
scanf("%d", &seconds);
hours = seconds/3600;
seconds -= hours*3600;
minutes = seconds/60;
seconds -= minutes*60;
printf("%d hours\n%d minutes\n%d seconds", hours, minutes, seconds);
return 0;
}
Downloads:
Download: count_time.c 352 B
Please login or Click Here to register for downloads
Count Time by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com
