0
Can someone explain how to use logical operators?
2 Respostas
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.