input "Number to convert:";a while 2^(n+1) < a n = n + 1 wend for i = n to 0 step -1 x = 2^i if a >= x then print 1; a = a - x else print 0; end if next