Professional Documents
Culture Documents
Making
Decisions
if x is 10, then
x == 10 is true,
x != 8 is true, and
x == 8 is false
if (expression)
statement;
Continued…
Copyright © 2012 Pearson Education, Inc.
if Statement in Program 4-2
Continued…
Copyright © 2012 Pearson Education, Inc.
Testing the Divisor in Program 4-9
This trailing
else
catches
invalid test
scores
(x <= z) || (y == z) false
(x <= z) || (y != z) true