Coding Reference

C
   Comments
   Flow Control
   Logical Operators
   Preprocessor Directives
   Types
C Libraries

Logical Operators

An expression can be a constant, a variable, or another logical statement
It is wise to place parenthesis around nested expressions to maintain the order of expression evaluation

expression > expression : Greater than
expression >= expression : Greater than or equal to
expression < expression : Less than
expression <= expression : Less than or equal to
expression == expression : Equal to
expression != expression: Not equal to

! expression : Not expression


logical statement && logical statement : Logical AND to and together two statements (both must be true)
logical statement || logical statement : Logical OR to or together two statements (either must be true)


the value 0 is false, anything non-zero is true
the = operator passes the value leftwards so (3 == (x = 3)) is true
Ad Placement
contact me | terms of use | copyright