|
|
Relational Operators |
|
<, <=, >, >= are the relational
operators.
==, != are the equality operators.
&& and || are the logical operators.
Expressions connected with logical operators are evaluated left to right. Evaluation stops as soon as the truth or falsehood of an expression is known.
False is represented by a zero, true is represented by a 1. In comparisons any non-zero number is true.
! performs a unary negation.
Examples
5 && 1 (true) 6 < 1 (false) !5 (false) !!5 (true since the value = 1)