i been trying trying to convert a number of seconds into days, hours, min and seconds. but i keep getting errors, "expected identifier or '('" . how should i fix it.`
#include <stdio.h>
#include <stdlib.h>
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
int main(void)
{
int seconds_in, days, hours, minutes, seconds, scan_count;
printf("Enter a number of seconds that is >= 0: ");
scan_count = scanf("%d", &seconds_in);
if (scan_count != 1)
{
printf("Unable to convert your input to an int.\n");
exit(1);
}
if (seconds_in < 0)
{
printf("%d s is out of range!\n", seconds_in);
exit(1);
}
printf("Doing conversion for input of %d s ... \n", seconds_in);
result= to_dhms(days, hours, minutes, seconds);
printf("That is %d day(s), %d hours(s), %d minute(s), %d second(s).\n",
days, hours, minutes, seconds);
return 0;
}
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
{
*d = total_s / 86400;
remaining= total_s% 86400;
*h= remaining/ 3600;
remaningofh= remaining%3600;
*min= remaningofh/ 60;
*s =remaningofh % 60;
return result;
}
`