Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
533 B
2
Indexable
#include <stdio.h>
int main()
{
    int day=0,hr=0,min,sec;
    scanf("%d",&sec);
    int k=sec;
    while (k)
    {
        k=k/86400;
        day++;
    }
    //printf("Day : %d\n",day);
    int h=sec-day*86400;
    hr=h/3600;
    //printf("Hour : %d\n",hr);
    int m=sec-day*86400-hr*3600;
    min=m/60;
    //printf("Minitue : %d\n",min);
    int s=sec-day*86400-hr*3600-min*60;
   // printf("Second : %2.0d\n",s);

    printf("Time in 'ddd:hh:mm:ss' is %d:%d:%d:%d",day,hr,min,s);
    
    return 0;
}