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