Challenge: Print Base 16 Integers

Try solving the problem of converting an integer of base 10 to base 16. Check if you can solve this problem using recursion.

Problem

Given an integer in decimal form, print its hexadecimal form. Use recursion to solve the problem.

Input

An integer.

Output

A string of the hexadecimal form of an integer.

Sample input

95

Sample output

5F

Coding exercise

Try to solve this yourself first. If you get stuck or need help, you can always press the ā€œShow Solutionā€ button to see how your problem can be solved. Weā€™ll look at the solution in the next lesson.

Good luck!

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.