174. Decimal-Hex-Binary converter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a simple program which enables you to enter a decimal, hexadecimal or binary number, and it then prints out the same number in all three formats. It is intended for decimal numbers from 0 to 255, hex numbers from &00 to &FF, (just prefix the number with "&"), and binary numbers from 00000000 to 11111111, (you must type 8 digits). Thus, typing in "70", "&46" and "01000110" should all produce exactly the same results, but note that there is little trapping against silly inputs. A nice refinement of the program would be for it to also print out the equivalent ASCII character, and to allow a single ASCII character input as an alternative to the ASCII code. There isn't enough space here, and anyway you can do that for yourself, CAN'T YOU? 10 REPEAT 20 INPUT"Number : "A$:IFLENA$<4THENA%=EVAL(A$)ELSEA%=FNbindec(A$) 30 PRINT;A%" &";~A%" ";FNdecbin(A%)' 40 UNTILFALSE 50 : 100 DEFFNbindec(A$):LOCALA%:IFLEN(A$)<8THENRUN 110 FORB%=7TO0STEP-1:A%=A%+VAL(MID$(A$,8-B%,1))*2^B%:NEXT 120 =A% 130 : 200 DEFFNdecbin(A%):LOCALA$ 210 FORB%=7TO0STEP-1:A$=A$+STR$((A%AND2^B%)DIV2^B%):NEXT 220 =A$