Operators and Precedence
Operators and Precedence
precedence
operators have a predefined order of
precedence. In other words, Quickbase acts on
certain operators before it acts upon others.
For example, * has higher precedence than +.
That is, in this expression 3+4*2 evaluates to
11, not 14.
QBASIC STATEMENTS.
1. CLS
This statement is used to clear the screen. Generally it is used at the starting of the
program. Syntax : CLS
2. REM
This statement is used to put comments in the program. It is non-executable statement.
We can use (') instead of REM. Syntax : REM
3. LET
It is an an assignment statement which is used to assign value to a variable. LET is an
optional statement. Syntax : Let x = 5
4. PRINT
It displays output on the screen. We can also use question mark (?) instead of PRINT
statement. Syntax : PRINT or ?
5. INPUT
The INPUT statement is used to accept data from the keyboard at the program execution
time. Syntax : INPUT ;
QBASIC STATEMENTS……..
6. END
END statement is used to terminate the execution of the program. It
stops the further processing of the program. Syntax : END
7. READ .... DATA
This statement can process large number of data, where LET and INPUT
statement can process only one data at once. This statement read the
given value of DATA statement and store them with suitable variable.
Syntax : READ , , ...
DATA , , ...
Examples of qb codes
1. CLS
INPUT "Enter First Number"; x
INPUT "Enter Second Number"; y
PRINT "Sum of "; x; " and "; y; " is "; x+y
END
2. CLS
READ x, y, z
av = (x+y+z)
PRINT "Average = "; av
DATA 10, 20, 30
END
BUILT-IN FUNCTIONS
Functions provided by QBASIC system are called
built-in or Standard or Library function in Qbasic.