
Patrick B. answered 07/09/19
Math and computer tutor/teacher
Division operator / returns the QUOTIENT of the integer division
Modulus operator returns the REMAINDER of the integer division
N is the number of seconds
sec = N % 60
min = N / 60
hours = min / 60
min = min % 60
days = hours/12
hours = hours % 24
years = days / 365
days = years % 365
============================================
Here is some code that works
#include <stdio.h>
int main(void)
{
long N = 120000000;
long numSeconds = N; /* copies the input # of seconds */
int sec = (int) (N % 60);
N = N / 60;
int min = (int) (N % 60);
N = N / 60;
int hours = (int) (N%24);
N = N/24;
int days = (int)(N%365);
N = N/365;
int years = (int)N;
printf(" %d years %d days %d hours %d minuts %d seconds \n",years, days, hours, min, sec) ;
}