Logical Operators

Logical Operators

Result: 
Explanation

The logical AND operator (&&) returns true if both operands are true and false otherwise. Our tool converts your input to binary and then performs the logical AND operation on the two binary numbers. The result is then converted to the output type you selected.

AND Operator truth table:
Input 1 Input 2 Output
0 0 0
0 1 0
1 0 0
1 1 1
Result: 
Explanation

The logical OR operator (||) returns true if either operands are true and false otherwise. Our tool converts your input to binary and then performs the logical OR operation on the two binary numbers. The result is then converted to the output type you selected.

OR Operator truth table:
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 1
Result: 
Explanation

The logical NOT operator (!) returns true if the operand is false and false if the operand is true. Our tool converts your input to binary and then performs the logical NOT operation on the binary number. The result is then converted to the output type you selected. We use the bitwise NOT operator (~) to perform the logical NOT operation.

NOT Operator truth table:
Input Output
0 1
1 0
Result: 
Explanation

The logical XOR operator (^) returns true if the operands are different and false if the operands are the same. Our tool converts your input to binary and then performs the logical XOR operation on the binary numbers. The result is then converted to the output type you selected.

XOR Operator truth table:
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 0
if()