answersLogoWhite

0


Best Answer

main()

{

int sec=00,min=00,hr=00;

printf("Enter time in seconds");

scanf("%d",&sec);

if (sec<60)

printf("%d :%d : %d",hr,min,sec);

else if(sec>=60)

min=int(sec/60);

sec=int(sec%60);

printf("%d: %d : %d",hr,min,sec);

else if (sec>=3600)

min=int(sec/60);

sec=int(sec/60)

hr=int(min/60);

printf("%d : %d : %d",hr,sec,min);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c program to convert time in sec to time?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert cubic feet per second to cubic feet?

Multiply by time. ft3 / sec * sec = ft3


How do you convert 20m sec to km sec?

20/meter/minut into km/sec


How do you convert hr into sec?

Hr/60 mins/60 sec


Write c program to find the distance traveled at regular intervals of time?

#include &lt;stdio.h&gt; #include &lt;math.h&gt; void main() { int tim_intrval, counter,time; float accl, distance=0, velos; clrscr(); printf("PROGRAM FOR CALC TOTAL DISTANCE TRAVELED BY A VECHIAL"); printf("\nNO OF TIME INTERVALS : "); scanf("%d",&amp;tim_intrval); for(counter = 1; counter &lt;= tim_intrval; counter++) { printf("\nAT T%d TIME(sec) : ",counter); scanf("%d",&amp;time); printf("\tVELOCITY AT %d sec (m/sec) : ",time); scanf("%f",&amp;velos); printf("\tACCLERATION AT %d sec (m/sec^2): ",time); scanf("%f",&amp;accl); distance += (velos*time + (accl*pow(time,2))/2); } printf("\nTOTAL DISTANCE TRAVELLED BY VEHICLE IN %d INTERVALS OF TIME : %f",tim_intrval,distance); getch(); }


Convert 1litre per sec to meter cubed per sec?

1 litre per sec = 0.001 cubic metres per sec.


Convert 9.314 cubic meters per second to cfs?

9.314m3/sec is about 328.92ft3/sec


Convert 8.32 min to sec?

499.2 seconds


How do you convert 0.3342 sec to minutes?

Divide by 60.


What is the answer to convert the 124.0 days into seconds?

10713600 sec


How you can convert seconds to days?

Sec/60/60/24


How do you convert rev per sec into rad per sec?

For starter, 1 rad/S = 0.159 rev/S


How do you convert cm sec - meters hr?

cm/sec, yes? ok, divide by 100 to go from cm to m. then multiply by 3600 to go from sec to hr