Relational Operators
int x, y, z;
x = 1; y = 4; z = 14;
Expression value
x < y + z -> 1 (true)
y == 2 * x + 3 -> 0 (false)
z <= x + y -> 0 (false)
z > x -> 1 (true)
x != y -> 1 (true)
The values of relational and logical expressions are 0 (for false) and 1 (for true).
This is Example 3.4.2, page 89.
Previous slide
Next slide
Back to first slide
View graphic version