- Joined
- Feb 3, 2009
- Messages
- 3,292
Can some one make me a program that will convert any number into the 0 and 1 language. I will demonstrate how it works :
Let's say i pick number 25:
12 x 2 + 1
6 x 2 + 0
3 x 2 + 0
1 x 2 + 1
0 x 2 + 1
so we have 25 = 11001
(the numbers we get must be writen from down to up) so 10011 is wrong.
Then for reverse from 11001 to 25 we do:
1 x 2^0 = 1
0 x 2^1 = 0
0 x 2^2 = 0
1 x 2^3 = 8
1 x 2^4 = 16
1 + 0 + 0 + 8 + 16 = 25
And we are done.
So if anyone can make this, i tryed but failed.
Let's say i pick number 25:
12 x 2 + 1
6 x 2 + 0
3 x 2 + 0
1 x 2 + 1
0 x 2 + 1
so we have 25 = 11001
(the numbers we get must be writen from down to up) so 10011 is wrong.
Then for reverse from 11001 to 25 we do:
1 x 2^0 = 1
0 x 2^1 = 0
0 x 2^2 = 0
1 x 2^3 = 8
1 x 2^4 = 16
1 + 0 + 0 + 8 + 16 = 25
And we are done.
So if anyone can make this, i tryed but failed.
