Hmm... Check your entire code just once to check for any logical errors. Just use pastebin and give the link, so I can also have a clean look at it.. we'll figure it out.. :)
Ohk, this is not the solution, but just as a by-the-by... line 72 is redundant, it does absolutely nothing. Also, assign Velocity(accel, ntime) to some variable, and then use the variable in your if and else loops. Calling a function 33 times in a program? Not very efficient.
EDIT1: Line 75 has an error. You're displaying Velocity. What is Velocity? you need to output Velocity(accel, ntime) (or use my above suggestion and display the variable). YOu've output correctly in the rest of the loops...
EDIT 2: Maybe ne555 was right... try using fgets() instead of gets()...
EDIT 3: Try this. After you've calculated values of h, m and s, just output them once. See if they satisfy the conditions in the time if loop. if they do, there is a logical error somewhere that we'll figure out, and if they don't then change the calcs...
Hmm... Try keeping the time in seconds... maybe the double type of data is nt working.. ? Have u tried using simple int? coz ders no need fr double in ur program...