Put your code to the user input into a post checking loop (do while) and keep yelling at the user until they entire something that is valid.1) How can i prevent user to enter a incorrect number.
You can do it with one function, just pass the base to the function.I think i must declare four functions: transToBinary, transToDecimal, transToHexa, transToOcta
We are not in the buisness of writting homework here.Is there anyone there who can solve this problem and help me to make this program
Other things I've noticed:
use tolower() or toupper() instead of the stacked case statements. While its legal its also fugly for this usage.
You need to get the number from the user as a string and not an int. You then have to convert the string into an int depending on the base.