# Thread: decimal to binary conversion

1. ## decimal to binary conversion

hi i want to make a program that spits out the binary equivalent of numbers from 0-10000. Any ideas how to get started.???

2. Sure, lots of ideas ;-)

Look into the bit-shift operators << and >> to move individual bits into a usable position (position 0 specifically) and the boolean operators & and | to isolate one bit.

3. This question gets posted easily every week. Try searching for it.

Quzah.

4. If you're not up to speed on bit shifting, you can use repeated integral division of the number divided by the Radix. For example, 150: 150 / 2 = 75 with a remainder of 0. The binary representation will come out in reverse order using the remainder values.

Hey WaltP.

5. Originally posted by ronin If you're not up to speed on bit shifting, you can use repeated integral division of the number divided by the Radix. For example, 150: 150 / 2 = 75 with a remainder of 0. The binary representation will come out in reverse order using the remainder values.
One wonders which is a more confusing response

Hey WaltP.
Hey back!!