Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

C Language Programming Library Reference Guide

Products

Sitemap

Online
Calculators

Circuits (A-C)

Circuits (D-O)

Circuits (P-Z)

Tutorials


 
Google
 
Web Hobbyprojects.com

Operators - Boolean

The Boolean operators return either 1 (true) or 0 (false).
expression1 && expression2
Returns the logical AND operation of expression1 and expression2. The result is 1 (true) if both expressions are true, otherwise the result is 0 (false).
 
e1 e2 Result
0 0 0
0 1 0
1 0 0
1 1 1

expression1 || expression2
Returns the logical OR operation of expression1 and expression2. The result is 0 (false) if bother expressions are false, otherwise the result is 1 (true).
 
e1 e2 Result
0 0 0
0 1 1
1 0 1
1 1 1

expression1 < expression2
Returns 1 (true) if expression1 is less than expression2, otherwise the result is 0 (false).

expression1 > expression2
Returns 1 (true) if expression1 is greater than expression2, otherwise the result is 0 (false).

expression1 <= expression2
Returns 1 (true) if expression1 is less than or equal to expression2, otherwise the result is 0 (false).

expression1 >= expression2
Returns 1 (true) if expression1 is greater than or equal to expression2, otherwise the result is 0 (false).

expression1 == expression2
Returns 1 (true) if expression1 is equal to expression2, otherwise the result is 0 (false).

expression1 != expression2
Returns 1 (true) if expression1 is not equal to expression2, otherwise the result is 0 (false).

 

Search
Custom Search

<<<  Back to C Language Library Reference Guide

<<<  Back to Electronics Tutorials