Overview
Test Series
An operator is a symbol used to carry out different types of actions in a program. There are many types of operators, like arithmetic, relational, logical, assignment, increment, conditional, bitwise, and shift operators.
Logical operators are mainly used to join two or more conditions and check if they are true or false. They always give a Boolean result, which means either true or false. These operators help in making decisions while a program runs. They can also be used to check or change certain bits in a number, making the program work faster.
In this article, we will explain the different types of logical operators and give examples of each.
A logical operator is a symbol or word that joins two or more expressions. The value of the new expression depends only on the original expressions and the meaning of the operator. AND, OR, and NOT are common examples of logical operators.
Maths Notes Free PDFs
| Topic | PDF Link |
|---|---|
| Class 12 Maths Important Topics Free Notes PDF | Download PDF |
| Class 10, 11 Mathematics Study Notes | Download PDF |
| Most Asked Maths Questions in Exams | Download PDF |
| Increasing and Decreasing Function in Maths | Download PDF |


Logical operators are commonly used to join two or more relational statements together.
The Basic three logical operators are:
A conjunction is formed by joining two statements with “and,” which means that both statements must be true for the entire compound statement to be true. Conjunctions are represented by the letter \(wedge\).
Conjunction Truth Table
|
A |
B |
A AND B (\(A\wedge B\)) |
|
True |
True |
True |
|
True |
False |
False |
|
False |
True |
False |
|
False |
False |
False |
A disjunction occurs when the connector between two statements is “or.” In this case, only one of the compound statements must be true in order for the entire compound statement to be true. Conjunctions are represented by the letter \( \vee \).
Disjunction Truth Table
|
A |
B |
A AND B (\( A\vee B \)) |
|
True |
True |
True |
|
True |
False |
True |
|
False |
True |
True |
|
False |
False |
False |
The mathematical operator negation returns the inverse of the given expression. It is also referred to as NOT and is represented by the letter \( \sim \).
Negation Truth Table
|
A |
Negation \(A\left [ \sim A \right ]\) |
|
True |
False |
|
False |
True |
The bitwise logical operators examine each bit in their operands one at a time and compute the corresponding bit value in the result. The binary bitwise operators and, or, and xor each have a left and right operand. The bitwise operator not is a unary operator with only one operand: the right operand.
A Bitwise And operator is denoted by ‘&,’ while a logical operator is denoted by ‘&&’. The following are some key distinctions between the two operators.
The table below shows the difference between logical and bitwise operators.
|
Logical operator |
Bitwise operator |
|
The programming language provides a type of operator called a logical operator to perform logic-based operations. |
The programming language provides a type of operator to perform computations called a bitwise operator. |
|
Logical operators are used to making decisions based on a variety of conditions. |
Bitwise operators are used to modify individual bits in an operand. |
|
Example: && , || |
Example: &, \(\wedge \), \(< < ,> >\) , \(\sim \) |
Operator precedence determines how terms in an expression are grouped and how an expression is evaluated.
|
Operator |
Precedence |
|
! |
High |
|
&& |
Medium |
|
|| |
Low |
Logical operators follow certain rules called properties, which help us understand how they work in logic and programming. These properties make solving logical problems easier and more systematic.
Commutative Property
Changing the order of the values does not change the result.
Example: A ∧ B = B ∧ A and A ∨ B = B ∨ A
Associative Property
Changing how the values are grouped does not change the result.
Example: (A ∧ B) ∧ C = A ∧ (B ∧ C)
Distributive Property
Logical operators can be spread over each other.
Example: A ∧ (B ∨ C) = (A ∧ B) ∨ (A ∧ C)
Identity Property:
Using TRUE or FALSE with certain operators keeps or changes the value.
Example: A ∧ TRUE = A and A ∨ FALSE = A
Negation Property:
The NOT operator changes TRUE to FALSE and FALSE to TRUE.
Example: ¬(¬A) = A
Domination Property:
When combined with a fixed value, the output is always that value.
Example: A ∨ TRUE = TRUE and A ∧ FALSE = FALSE
Computer Programming
Logical operators help a program make choices. They decide how the program runs depending on certain conditions. For example, the AND operator runs the code only if all conditions are true. The OR operator runs the code if at least one condition is true.
Mathematics and Logical Reasoning
In maths, logical operators are used to check statements and solve reasoning problems. They show whether a statement is true or false. They are often used in logic problems and truth tables.
Electronics and Digital Circuits
Logical operators are used in digital electronics. Logic gates like AND, OR, and NOT are used in circuits to handle signals and make decisions. These are used in devices like computers, calculators, and mobile phones.
Database Searching and Filtering
Logical operators are used in databases to find or filter data. For example, AND combines two conditions, OR widens the search, and NOT removes unwanted results.
Everyday Decision-Making
Logical thinking with these operators helps people make smart choices. For example, “I will go out if it’s sunny OR if I have an umbrella” shows how logical operators are used in daily life.
Example: 1 Which of the following operators is used to perform logical operations?
a) ||
b) &&
c) %%
d) && and ||
Answer : d
Explanation: The operators && and || are used for logical operation, acting as AND and OR conditions.
Example: 2 Both commands are executed when we use ||.
a) False
b) True
Answer: a
Explanation: The shell uses the || operator for conditional execution. It serves an inverse function in that the second command is executed only if the first fails.
If you want to score well in your math exam then you are at the right place. Here you will get weekly test preparation, live classes, and exam series. Download the Testbook App now to prepare a smart and high-ranking strategy for the exam.

Download the testbook app and unlock advanced analytics.

Scan this QR code to Get the Testbook App