Header Ads

Header ADS

Solution of URI 1019::Time Conversion

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.





#include <stdio.h>
int main ()
{

    long int TS;
    int h,m,s;
    float H,M,S;

    scanf("%ld",&TS);

    h=TS/3600;
    TS=TS-(h*3600);
    m=TS/60;
    TS=TS-(m*60);
    s=TS;
    printf("%d:%d:%d\n",h,m,s);


    return 0;

}



No comments

Theme images by konradlew. Powered by Blogger.