Wednesday, March 9, 2011

2.6 Relational and Logical Operators

  • Relational operators (same precedence): >, >=, <, <=
  • Equality operators (lower precedence than relational): = =, ! =
  • Relational operators have lower precedence than arithmetic
  • Logical operators (evaluated left to right): && , | |
  • Precedence of && is higher than ||
  • Logical operators' precedence is lower than equality and relational
  • Unary negation operator ! convert a non-zero operand into 0 and a zero operand into 1 (ie. !valid)

No comments:

Post a Comment