Search This Blog

Logical operators in programming

 In programming, we often use 3 logical operators:
 - &&: logical and. && combines two boolean values and returns a boolean which is true if and only if both of its operands are true
 - ||: logical or. || combines two boolean variables or expressions and returns a result that is true if either or both of its operands are true
 - !: which means not. It reverses the value of a boolean expression. Thus if b is true !b is false. If b is false !b is true
Share:

No comments:

Blog Archive

Powered by Blogger.

Blog Archive

Recent Posts

Pages