Code:
#include <stdio.h>
#include <stdlib.h>
main()
{
int minutes = 60;
int total_seconds;
double mins, seconds, hours;
printf("Input Seconds: ");
scanf("%i", &total_seconds);
hours = (total_seconds / minutes) / minutes;
mins = total_seconds / minutes;
seconds = total_seconds % minutes;
printf("Converted = %.0lf:%.0lf:%.0lf\n\n", hours, mins, seconds);
system ("pause");
return(0);
}
Minutes are still calculating incorrectly ? Grrr! I feel stupid. I make it happen on paper, but can't translate to C.