Relational expressions
Arithmetical expressions may be compared with a set of operators (see
the table above).
The comparison returns a boolean value: true or false. This boolean
value may be assigned to a variable or used as the condition of a control
structure, the "if" one for example.
Relational operators
=
< <= > >= <> in match |
equal less less or equal greater greater or equal not equal (the != C symbol is also valid) member of a list matches a user-defined function |
Examples ot relational expressions: | int
x = 4 int y= 5 boolean b = x < 10 if y = 5 print "equal" print x < y print x = y |
Displays (criptol C++): | >
equal > true > false |
Exercises |
1) Four integer variables, a, b, c, d, are assigned the values 5, 10,
15, 20. |