11. C Program to convert Seconds into Hours and Minutes.
How does this program work?
- In this programme you will learn about how to convert Seconds into Hours and Minutes.
- First user has to Enter how many seconds that to convert.
- This programme perform mathematical calculation and display the result using C language.
Here is the code
#include <stdio.h>
int main(void)
{
int s,h,m;
printf("Enter number of seconds\n");
scanf("%d",&s);
h=s/3600; //Converts seconds into hours
m=s/60; //Converts seconds into minutes
printf("%d seconds = %d hour \n",s,h);
printf("%d seconds = %d minutes",s,m);
}