Sunday, February 24, 2013

QBASIC Control Statements. QBASIC Looping

QBasic is a programming language, created by Microsoft. It is based upon the original language BASIC (Beginners All-purpose Symbolic Instruction Code).

Control Statements
A program consists of a number of statements which are usually executed in sequence. Control statements allow you to change the computer's control from automatically reading the next line of code to reading a different one. The Control Statements are used for controlling the Execution of the program

There are three types of loops for QBASIC.
  1. While..Wend 
  2. Do Loop 
  3. For Loop
The While Loop’s syntax
WHILE [condition]
[Statement Block]
WEND

Example
CLS
B=1
WHILE B<=9
PRINT B
B=B+1
WEND
END

0 comments:

Post a Comment