C Program to convert a decimal number to binary, octal and hexadecimal using recursion

The following is a C program to convert a decimal number to binary, octal and hexadecimal using recursion:

Expected Output:

How it works

The following figure shows how the evaluation of convert_to_x_base(4, 2) takes place:

Evaluation of convert_to_xbase(4, 2)


Recommended Reading:

Leave a Comment

%d bloggers like this: