Normally programs are executed from top to bottom, in the order that they are written. But sometime it is required to alter the flow of sequence of instructions in a the program. For that QBASIC provide some statements that can alter the flow of a sequence of instructions. The statement which alter and transfer the flow of program from one statement line to another are called control statements.

Mainly, there are two types of control statements in QBASIC. They are :

  1. Branching Statement
  2. Looping Statement
Branching Statement Looping Statement
  • IF … THEN
  • FOR … NEXT
  • IF … THEN … ELSE
  • WHILE … WEND
  • IF … THEN … ELSE IF
  • DO … LOOP
  • SELECT … CASE
  • GOTO

Branching Statement also further divided into two types :

  1. Conditional Branching Statement
    • IF … THEN
    • IF … THEN … ELSE
    • IF … THEN … ELSE IF
    • SELECT … CASE
  2. Unconditional Branching Statement
    • GOTO

Note: There is only one unconditional branching statement in QBASIC Programming, that is GOTO statement

<< Table of Content >>