0
Can someone explain how to use logical operators?
2 Answers
0
! â NOT â inverts its operand.
&& â AND â returns true only if both operands are true.
|| â OR â returns true if at least one of operands is true.
0
You can use logical operators in conditional statements such as if statement like
if(a==0 && b==0) -> condition will be true only if both are zero
if(a==0 || b==0) -> condition will be true only if any one of them is zero
if(!(a==0 && b==0)) -> it will negate the output of the condition.