A fairly simple program used to solve the missing length of a right triangle! It works perfectly fine but I would like to know what i could do to the code to make it
a) work better
b) shorter
make any changes to the code that you want, just try to make any huge changes.
THANKS! :D
(note* I know theres a lot of unnecessary spaces, but give me a break! this thread is for beginners.)
1)Replace the goto by a loop. Makes the whole thing easier to read.
2)Check if the values are actually valid before using them. (means, check whether the 3 sides actually make a triangle).
3)Check your input for fails before doing the next input.
4)Don't depend on side C being the longest.
5)replace math.h by cmath. math.h is outdated.