I know how to do this math problem by hand, but i wouldnt know how to get a program to do it..... This is the problem

INPUT is 11:
_____
2| 11 = 5 Remainder 1

Take the answer 5
(Divide it by 2)
_____
2| 5 = 2 Remainder 1

Take the answer 2
(Divide it by 2)
______
2 | 2 = 1 Remainder 0

Take the answer 1
(Divide it by 2)
______
2 | 1 = 0

Now you take the remainders backwards...the answer is
1011

How the hell can i do that?