#include<stdio.h>
int main()
{
int
S, h, m, s;
printf(
"Second:
" );
scanf(
"%d"
, &S);
h=S/3600;
S=S%3600;
m=S/60;
s=S%60;
printf("\nhh:mm:ss\n%d:%d:%d",
h,
m, s);
return
0;
}
|
Write a program that obtains hours and minutes from seconds.
ReplyDelete"??
ReplyDelete@shamos saqr
ReplyDeletes=S%60; //Don't write this statement if you no need of second in result and remove %d for s in printf funtion
why 3600?
ReplyDeletebecause one hour is 3600 seconds
Deletethank you sir
ReplyDeleteWrite a C program to convert minutes into hour and minutes.
ReplyDeleteIt will be added soon. Thank you!
Delete