Number Base Conversion

Date: 198x
Type: Program
Platform(s): TS 1000

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10001 – 10050.

Related Products

Related Articles

Related Content

Image Gallery

Number Base Conversion

Source Code

   5 REM %N%R% %B%A%S%E% %C%O%N%V%E%R%S%I%O%N
  10 LET B$="BASE 10 NO.="
  20 LET C$="BASE 2 NO.="
  50 PRINT "NUMBER BASE CONVERSION"
  60 PRINT ,,"CHANGING FROM WHICH BASE?","2 OR 10?"
  70 INPUT T
  80 CLS 
  90 IF T=2 THEN GOTO 600
 110 PRINT 
 120 PRINT ,,B$;
 130 INPUT T
 140 PRINT T
 145 PRINT C$;
 160 FOR J=INT (LN T/LN 256*8) TO 0 STEP -1
 170 IF 2**J>T THEN GOTO 210
 180 LET T=T-2**J
 190 PRINT "1";
 200 GOTO 220
 210 PRINT "0";
 220 NEXT J
 230 GOTO 110
 600 LET T=0
 610 PRINT 
 620 PRINT ,,C$;
 630 INPUT A$
 640 PRINT A$
 650 FOR J=0 TO LEN A$-1
 660 LET T=T+VAL A$(LEN A$-J)*2**J
 670 NEXT J
 680 PRINT B$;T
 690 GOTO 600
 700 SAVE "1004%3"
 800 RUN 

People

No people associated with this content.

Scroll to Top