Logical Operators
int x, y, z;
x = 1; y = 4; z = 14;
Expression value
x <= 1 && y == 3 -> 0 (false)
x <= 1 || y == 3 -> 1 (true)
!(x > 1) -> 1 (true)
!x > 1 -> 0 (false)
!(x<=1 || y==3) -> 0 (false)
x >= 1 && y == 3 || z < 14
0 (false)
This is Example 3.4.4, page 91
Previous slide
Next slide
Back to first slide
View graphic version