10 REM 'ON-GOSUB' TEST PROGRAM
20 PRINT "ENTER THE NUMBER 1,2 OR 3";
30 INPUT X
35 IF X = -999 THEN 999
40 PRINT "THE ON-GOSUB STATEMENT ";
50 ON X GOSUB 100,200,300
60 GOTO 20
100 REM SUBROUTINE #1
110 PRINT "BRANCHED TO SUBROUTINE #1"
120 RETURN
200 REM SUBROUTINE #2
210 PRINT "BRANCHED TO SUBROUTINE #2"
220 RETURN
300 REM SUBROUTINE #3
310 PRINT "BRANCHED TO SUBROUTINE #3"
320 RETURN
999 END
