[Coco] Converting Dec to Binary
Christopher R. Hawks
chawks at dls.net
Wed Mar 21 12:50:03 EDT 2018
On Wed, 21 Mar 2018 11:40:05 -0500
Allen Huffman <alsplace at pobox.com> wrote:
> On Mar 21, 2018, at 9:41 AM, phil pt <ptaylor2446 at gmail.com> wrote:
> >
> > Has anyone seen a program already developed that converts dec to
> > Binary?
>
> Remove spaces to make it run a tad faster...
>
> 5 INPUT”DECIMAL NUMBER”;A
> 10 FOR Z=7 TO 0 STEP-1:IF (2^Z AND A) THEN PRINT”1”; ELSE PRINT”0”;
> 15 NEXT:PRINT
>
>
>
Allen:
You forgot one line.
0 REM THIS HOW IT WORKS
(For those who don't speak binary.)
There are 10 kinds of people in the world.
Those that understand binary, and those that don't!!
Christopher R. Hawks
HAWKSoft
--
UNIX command of the day:
# cat 'the can of tuna'
cat: cannot open the can of tuna
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
More information about the Coco
mailing list