Answer:
Yes. The two fragments are equivalent.
Often reversing the order of the branches of an if statement
makes a program easier to read.
End of Chapter
That is the end of this chapter. If (you are a good student) or (you are interested) you may wish to review the following.
- Relational expressions.
- Logical operators.
- AND Operator, &&.
- Checking that numbers are in a specified range.
- Writing complete boolean expressions.
- OR Operator, ||.
- Comparison between AND and OR.
- The NOT operator !