10 PRINT "DERIVATIVE"
20 PRINT
30 REM - ENTER DEFFNC(x) HERE
35 DEF FNC(X)=X[2+COS(X)
40 PRINT "(ENTER X=99999 TO END PROGRAM)"
50 PRINT "DERIVATIVE AT X=";
60 INPUT X1
69 REM - TEST FOR END OF PROGRAM
70 IF X1=99999 THEN 160
80 D=0
89 REM - CALCULATE DIFFERENCE QUOTIENTS FOR POINTS APPROACHINGX
90 FOR N=1 TO 10
100 D1=D
110 X=X1+.5[N
120 D=(FNC(X)-FNC(X1))/(X-X1)
130 NEXT N
139 REM - APPROXIMATE DERIVATIVE OF FUNCTION AT X, PRINT
140 PRINT "                    IS";2*D-D1
149 REM - RESTART PROGRAM
150 GOTO 50
160 END
