print hexadecimal representation of an int
i am looking for a pseu开发者_JAVA百科docode that prints the hexadecimal represenation of an integer as string.
thanks!
- Take the remainder of the integer modulo 16
- Convert the remainder to a hex digit
- Place the hex digit into the left-most position in the output string
- Divide the integer by 16
- Repeat the above until the value is zero
精彩评论