Bloomberg Interview Question

Changing base of a number

Interview Answer

Anonymous

Aug 30, 2010

do successive divides to change bases. (1) do a modulo divide of the target number by the base number. Write the result as the most significant. (2) get the quotient of the target number divided by the base number. (3) use the quotient in (2) as the target number and repeat steps (1) and (2) until the quotient is zero and the remainder is the most significant of the result.

1