Well it would be better in my opinion. Also I would make it so they was a limit on max number of inches you could enter/ and max number of height (no ones over 8 foot are they? 8 foot 24 inches? How about weight? 12000 lbs? If your going to go through all the trouble of making sure the user doesn't enter a negative number cause it's not realistic then may as well. Also inside a loop with all three I would print the values back out and want comfimation all data enter was correct. Accidently entering weight for inches... or something similar It would be even worse having to enter two more things needlessly when you know the result is going to be wrong in the final outcome cause you did a typo at the first prompt.
How to enter 6 foot exactly in your coode? 5foot 12 inches?
also my way you lose a variable inches and feet. (you dont need as many as you still have)
That may be so, but repeating correct information just because you did a mistake on one is just annoying. It should re-prompt ONLY for the data you enter incorrectly, and optionally prompt at the end if all the data is correct, but NEVER should it ask a user to re-enter information they've already entered correctly. Then we might as well go back to terminating the program if wrong info is entered.
Originally Posted by Adak
io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
Originally Posted by Salem
You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.
Outside of your DOS world, your header file is meaningless.