GOTO Statement


It is a only one unconditional branching statement in QBASIC Programming Language. It transfer the flow of program from one statement line to another statement line without checking any condition.

Syntax: 

  GOTO [line number / line label]  

Example 1

CLS
n = 1
top:
PRINT n;
n = n + 1
IF n <= 20 THEN GOTO top
END

Example 2

CLS
INPUT "Enter your marks "; m
IF m >= 35 THEN GOTO p
IF m < 35 THEN GOTO f
p: PRINT "You are Passed"
END
f: PRINT "You are Failed!"
END

  9028