the program to which you're referring simply calculates the running time of your program. it has nothing to do with the actual unit conversion taking place. the code you posted appears to work fine. i tested it out with a few inputs and received the expected output. a program like this is simple enough that you shouldn't need to have so many external files and headers. A single main() function should do the trick (see below).
Code:
#include <stdio.h>
#define SECS_PER_DAY 86400
#define SECS_PER_HOUR 3600
#define SECS_PER_MIN 60
int main() {
int days, hours, minutes, seconds;
/* accept input from user, verify input was correctly received and stored */
printf("\nEnter a number of seconds: ");
scanf("%d", &seconds);
printf("You entered %d seconds.\n", seconds);
/* conversion steps */
days = seconds / SECS_PER_DAY;
hours = (seconds % SECS_PER_DAY) / SECS_PER_HOUR;
minutes = ((seconds % SECS_PER_DAY) % SECS_PER_HOUR) / SECS_PER_MIN;
seconds = ((seconds % SECS_PER_DAY) % SECS_PER_HOUR) % SECS_PER_MIN;
/* print converted time units */
printf("\n%d day(s), %d hour(s), %d minute(s), and %d second(s).\n", days, hours, minutes, seconds);
}
i'm not sure which platform you're running this on, or which compiler you're using. but if you simply compile (e.g. gcc timeconverter.c) and run (e.g. ./a.out) this program, it should work just fine. the output should look like this:
Code:
xdelta~/code gcc converter.c
xdelta~/code time ./a.out
Enter a number of seconds: 95000
You entered 95000 seconds.
1 day(s), 2 hour(s), 23 minute(s), and 20 second(s).
real 0m3.310s
user 0m0.000s
sys 0m0.000s
the last part of the output (real, user, sys, etc.) will only appear when you precede "./a.out" (or whatever you elect to name your executable) with "time" (assuming a linux environment). again, the time is unnecessary, unless you're required to include it for some other reason (perhaps a homework assignment).