1019 - Time Conversion

Problem Link

A Solution in c



#include<stdio.h>
int main()
{
    int n, hours, minutes, temp;
    scanf("%d", &n);
    hours = n / 3600;
    temp = n % 3600;
    minutes = temp / 60;
    temp = temp % 60;
    printf("%d:%d:%d\n", hours, minutes, temp);
    return 0;
}




No comments

Theme images by Jason Morrow. Powered by Blogger.