Category talk:GW-BASIC examples needing attention
1 REM PC-BASIC (GW-BASIC) PROGRAM TO GENERATE CATALAN NUMBERS
2 REM USING NUMBER TRIANGLEMATRIX METHOD
10 K=16
20 DIM S(K,K)
30 FOR I=1 TO K
40 S(1,I)=1
50 NEXT
60 FOR I=2 TO K
70 FOR J=1 TO I-1
80 LET S(I,J)=S(I-1,J)+S(I,J-1)
90 NEXT
100 LET S(I,I)=S(I,I-1)
110 PRINT "Catalan(";I-1;") = ";S(I,I)
120 NEXT
130 END