General Motors (GM) interview question

Convert a number string to BCD