r/programmingrequests • • Mar 02 '20
solved C program If Else program that calculates meters 3 places in each direction (from meter up to kilo or milimeter)
I want it to calculate what a meter converts to in a if else system. So I would put in 10 or 70352 meters and it calculates up to kilo so 3 places up (deka hecto then kilometer) or downward up to millimeter. I dont know how to do both math and a if else statement. the program would prompt you to enter a meter value and it would output it in the correct form (10 meters = .1 kilometers)
0
Upvotes
View all comments
Show parent comment
0
u/[deleted] Mar 02 '20
The assignment requires me to do everything between kilo and milimeter and it decides if its closer to km or mm if it has a decimal in it becuase a .9 will always be lower then a meter so it chooses lower meter incramints and if I were to put in anything from one meter to ten it would stay in meters