How to divide by 9 using just shifts/add/sub?

Viewed 2276

Last week I was in an interview and there was a test like this:

Calculate N/9 (given that N is a positive integer), using only SHIFT LEFT, SHIFT RIGHT, ADD, SUBSTRACT instructions.

2 Answers
Related