Hello you guys. Im writing a program that calculates 4 parameters: velocity, acceleration, distance, time. Part of my program is to implement an output that adds all the times and prints it into min and seconds and the type that im working with is float. The problem that im having is that i could add all the times but i dont know how to seperate them into minutes and seconds. An example just to show you what im doing wrong is right below:
CODE Total_Time = Time_Leg1 + Time_Leg2 + Time_Leg3;
printf("Total time of travel: : %f min %f sec\n", Total_Time, Total_Time);
RESULTING OUTPUT
Total time of travel: 110 min 110.000000 sec
WHAT IT SHOULD BE DOING
Total time of travel: 1 min 10.000000 sec
Could any would give me some suggestions on how bout I can solve this problem?