Base Conversion
We have seen the program to displaying the series of number and its sum. Now we will write a recursive function which will convert a decimal number to binary, octal and hexadecimal base.
To do this conversion we have to divide the decimal number repeatedly by the base till it is reduced to 0 and print the remainders in reverse order.
If the base is hexadecimal then we have to print alphabets for remainder values greater than or equal to 10. We want to print the remainders in reverse order, so we can do this work in the unwinding phase.