Solution: Number Base Conversion
Look at different ways to implement solutions to these number conversion problems.
We'll cover the following...
We'll cover the following...
Decimal to hex
Explanation
Line 1: We create an array of characters representing hex values against the decimal numbers 0–15.
Line 4: The remainder—from the division of
numberby 16—is first converted to a hexadecimal string and prepended to the stringhexadecimal.Line 5:
numberis updated so that it stores the quotient from ...