Which Is Bigger: Using Relational Operators and Expressions

Because while loops often rely on test expressions that make comparisons, comparison expressions merit a closer look. Such expressions are termed relational expressions, and the operators that appear in them are called relational operators. You have used several already, and Table 6.1 gives a complete list of C relational operators. This table pretty much covers all the possibilities for numerical relationships. (Numbers, even complex ones, are less complex than humans.)

Table 6.1. Relational Operators
Operator Meaning
< Is less than
<= Is less than or equal to
== Is equal to
>= Is greater than or equal to
> Is greater than
!= Is not equal to

The relational operators are used to form ...

Get C Primer Plus, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.