This is a program that converts any whole number from base 2,8,10 and 16 to any of the same bases.
Convertions of Binary and octal to/from decimal or hexadecimal are more or less the same. Thus are combined in one function. While converting between these two, I used a temp variable to convert it into decimal and then to the required base.