Hello friends, today I'm going to give you a program that will convert any inputted number from decimal to any specified base between 2 to 16, including the -ve numbers.
So the first question is how to convert a number in base 10 to a specified base. The answer is rather simple. Just keep dividing the number with the new base and record the remainder each time until the quotient becomes not divisible by the base. When this happens, rearrange the remainders recorded earlier in reverse order to get the converted number. Here is an example: