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

Printable View

- 05-29-2003noob2cdecimal 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.???

- 05-29-2003WaltP
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. - 05-29-2003quzah
This question gets posted easily every week. Try searching for it.

Quzah. - 05-29-2003ronin
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. - 05-29-2003WaltPQuote:

*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.**

Quote:

**Hey WaltP.**