Given a base 10 number, print the hexidecimal (base 16) representation of that number.
Anonymous
String buffer = new StringBuffer(); while (n > 0) { int base = n% 16; buffer.append((base<10 ? base : (Char)('a'+base-10)); n /= 16; } String result = buffer.toString().reverse();
Check out your Company Bowl for anonymous work chats.