Chapter 6


  1. You can use nested if statements as an alternative to the logical And and Or operators.

  2. An if statement can be nested in the else if or else part of an if / else if / else statement, as well as the if part.

  3. With the logical And operator, both Boolean expressions have to be true for the overall Boolean expression to be true.

  4. With the logical Or operator, both Boolean expressions have to be false for the overall Boolean expression to be false.

  5. The logical Not operator reverses the truth of a Boolean expression, making a true expression false and a false expression true.

  6. Assuming resident is a Boolean variable, if(resident) is the same as if(resident == true).

  7. The logical Not operator is a unary rather than binary operator.

  8. The logical Not operator has a higher precedence than the relational operators.

  9. The logical And operator has a higher precedence than the logical Or operator.

  10. A Boolean value of either true or false can be used following the case keyword in a switch statement since both true and false have corresponding integer values.




C++ Demystified(c) A Self-Teaching Guide
C++ Demystified(c) A Self-Teaching Guide
ISBN: 72253703
EAN: N/A
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net