Multiply 1

Developer(s): George Chambers
Date: 1983
Type: Program
Platform(s): TS 2068

Program will enable you to multiply any two multi-digit numbers together and obtain an accurate answer.

Appears on

Library tape of the Indiana Sinclair Timex User’s Group.

Source Code

   10 REM    This program will enable you  to multiply any two multi-digit numbers together and obtain an  accurate answer
   20 REM  BY G. F. CHAMBERS An expansion of a routine foundin the June 1983 issue of "YOUR COMPUTER" magazine,    page 54   
   30 CLS 
   40 PRINT TAB 8;"MULTIPLICATION"
   50 PRINT TAB 8;"\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
   60 INPUT "Enter the first number ";x$
   70 INPUT "Enter the second number ";y$
   80 DIM a(LEN x$+LEN y$+1)
   90 FOR m=LEN x$ TO 1 STEP -1
  100 FOR n=LEN y$ TO 1 STEP -1
  110 LET c=m+n
  120 LET r=1
  130 LET b=VAL x$(m)
  140 LET a(c)=VAL y$(n)*b+a(c)
  150 LET i=INT (a(c)/10)
  160 LET a(c)=a(c)-(i*10)
  170 LET a(c-1)=a(c-1)+i
  180 NEXT n: NEXT m
  190 PRINT AT 5,0
  200 PRINT x$;" x ";y$;" = "''
  210 IF a(1)=0 THEN LET r=2
  220 FOR p=r TO (LEN x$+LEN y$)
  230 PRINT a(p);: NEXT p
  240 PRINT AT 15,1;"Another multiplication? (y/n)"
  250 IF INKEY$="" THEN GO TO 250
  260 IF INKEY$="y" OR INKEY$="Y" THEN RUN 
  270 STOP 
  280 SAVE "MULTIPLY" LINE 20
Scroll to Top