Relational Operators

C++ has the same operators that are used in arithmetic, but some of the symbols are different:
Arithmetic C++ Meaning
= == Equal to
=/ != Not equal to
< < Less than
> > Greater than
< <= Less than or equal to
> >= Greater than or equal to

C++ also has an ordering or operator precedence, similar to arithmetic:
Operator Precedence
( ) 1
*, /, % 2
+, - 3
<, >, <=, >= 4
==, != 5

Next page
Previous page
Go to Lesson 7 index.


HTML by Jennifer Keiser.
Sponsored by Inspiration, the diagramming and outlining tool.