"ABCDEF" = "ABCDEF"
"ABCDEF"
<>"ABCDE"
"ABCDEF"
>"ABCDE"
Relational expressions are either True
or
False. The PC-3 represents True
by
a 1; False
is
represented by a
0.
In
any logical test,
an expression which evaluates
to
1
or
more
will
be
regarded
as
True, while one which evaluates
to
0 or
less
will
be
considered False.
Good programming practice, however, dictates the use of
an
explicit relational expression instead of relying on this coincidence.
Logical
Expressions
Logical expressions are relational expressions which use the operators AND, OR, and NOT. AND and
OR
are used
to
connect two
relational expressions; the value of the combined expression
is
shown
in
the following tables:
A AND
B
Value
of
B
A
OR
B
Value
of
B
Value of A
True
False
True True False
False False False
Value of A
True
False
True True True
False True
False
(Cf. Values of A and B must be
0 or
1)
52