Operators

(expression)

Brackets are used to group expressions.

PRINT 3*(5+3)
15

n1 * n2

The * operator is used to multiply two numbers.

n1 + n2

s1 + s2

The + operator is used to add 2 numbers, or to concatenate 2 strings.

PRINT 2+3
5
PRINT "ABC"+"DEF"
ABCDEF

n1 - n2

The - operator is used to subtract n2 from n1.

PRINT 12-7
5

n1 / n2

The / operator divides n1 by n2.

PRINT 11/3
3.6666666666666

n1 ^ n2

The ^ operator raises n1 to the power of n2.

PRINT 2^3
8

expression1 AND expression2

The AND operator returns true (non-zero) if both expression1 and expression2 are true, otherwise it returns false (zero).

A=4
IF A=2+2 AND A=2*2 THEN PRINT "Both expressions are true!"

expression1 OR expression2

The OR operator returns true (non-zero) if either expression1 is true or expression2 is true, otherwise it returns false (zero).

A=4
IF A=1+1 OR A=2*2 THEN PRINT "One of these expressions is true!"