#include <stdio.h>

#define MINUTE 60
#define HOUR 3600
#define DAY 86400

// This program converts a number of seconds into days, hours, minutes and seconds.
int main() {

	// input variable.
	int input_seconds;

	// variables we'll be calculating.
	int days, hours, minutes, seconds, remainder;

	// get the total number of seconds from the user.
	printf("Please enter the number of seconds: ");
	scanf("%i", &input_seconds);

	// calculate the days, hours, minutes and seconds.
	days = input_seconds / DAY;
	remainder = input_seconds % DAY;

	hours = remainder / HOUR;
	remainder %= HOUR;

	minutes = remainder / MINUTE;
	remainder %= MINUTE;

	seconds = remainder;


	// output the results.
	printf("%i seconds = %i days, %i hours, %i minutes and %i seconds.\n",
			input_seconds, days, hours, minutes, seconds);

	return 0;
}

