Answer INPUT N with the number of unknowns, then enter the coefficients and the constant of each equation as K(1,1), K(1,2) and so on. The program solves the set by elimination and prints the value of each unknown. The article also prints changes that turn it into a polynomial curve fit.
As printed, line 80 reads FOR H=I TO I-1 and line 110 NEXT H, so the elimination step is skipped and the answers are wrong. The March 1982 Syntax Errors column corrected them to FOR H=1 TO I-1 and NEXT J, and the printed Syntactic Sum is that of the corrected program. The download has both versions. In lines 2 and 25 the word INPUT inside the quotes is the INPUT keyword (as the article says to type it).
Published in Syntax February 1982 (Solving Simultaneous Equations).
Source Code
2 PRINT " INPUT N"
4 INPUT N
6 CLS
8 DIM K(N,N+1)
10 FOR I=1 TO N
20 FOR J=1 TO N+1
25 PRINT " INPUT K(";I;",";J;")"
30 INPUT K(I,J)
35 CLS
40 NEXT J
50 NEXT I
60 FOR I=1 TO N
70 FOR J=I TO N
80 FOR H=I TO I-1
90 LET K(J,I)=K(J,I)-K(J,H)*K(H,I)
100 NEXT H
110 NEXT H
120 FOR J=I+1 TO N+1
130 FOR H=1 TO I-1
140 LET K(I,J)=K(I,J)-K(I,H)*K(H,J)
150 NEXT H
160 LET K(I,J)=K(I,J)/K(I,I)
170 NEXT J
180 NEXT I
190 FOR I=N TO 1 STEP -1
200 FOR H=I+1 TO N
210 LET K(I,N+1)=K(I,N+1)-K(I,H)*K(H,N+1)
220 NEXT H
230 NEXT I
240 FOR I=1 TO N
250 PRINT "U(";I;")=";K(I,N+1)
260 NEXT INote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

