hello i want to print convert seconds into days, hours, munite, and seconds but i do not know how to call void into line 28 so it can print.
#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);
{
//how can i call void to_dhms here
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;
}