table of numbers

hi, I am asked to make an application that displays table of decimal numbers in range of 1 to 256 the program should display the decimal number binary, octal and hexadecimal equivalents.

my problem is with the hexadecimal equivalents, I can handle the decimal numbers from 10 to 15 to be displayed as letters from A to F
but I cannot handle them while they're part of hexadecimal number. for example I can not display number like this "4D3B"