CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Comparisons:

two values can be compared using relational operators.

relational operators:

==

equal to

!=

not equal to

<

less than

<=

less than or equal to

>

greater than

>=

greater than or equal to
The condition must be enclosed in parentheses!

examples:

(allowance <= expense)
(age != 21)
(age == 18)

 

 

 

 

 

ex .

allowance>=expense

age!=21

age==18