Hint
Code:
char table[] = "0123456789ABCDEF";
output += table[input % base];