C Program to convert minutes into hour and minutes


C Program to convert minutes into hour and minutes

#include<stdio.h>
int main()
{
    int m,hr,min;
    printf("Enter time in minutes");
    scanf("%d",&m);
    hr=m/60;
    min=m%60;
    printf("Hour=%d \t Minutes=%d",hr,min);
return 0;
}

C Program to convert seconds into hour , minutes and seconds

Answer:
#include <stdio.h>
int main()
{
    int s,hr,min,sec,s1;
    printf("Enter time in seconds");
    scanf("%d",&s);
    hr =s/3600;
    s1=s%3600;
    min = s1/60;
    sec = s1%60;
    printf("Hours=%d Minutes=%d Seconds=%d",hr,min,sec);
    return 0;
}