Which of the following operators in a programming language typically performs…
2025
Which of the following operators in a programming language typically performs a logical operation and returns a Boolean value as a result?
- A.
Arithmetic Operator
- B.
Logical Operator
- C.
Relational Operator
- D.
Assignment Operator
Attempted by 266 students.
Show answer & explanation
Correct answer: B
The correct answer is Option B, Logical Operator. A logical operator performs operations on Boolean values (true or false) and returns a Boolean result, which is essential for controlling program flow in conditional statements. Common examples include AND (&&), OR (||), and NOT (!) operators used to combine or negate conditions. In contrast, Arithmetic Operators (Option A) perform mathematical calculations like addition and multiplication, returning numeric values rather than Boolean ones. Relational Operators (Option C) compare two values to determine relationships like greater than or less than, returning a Boolean value but specifically for comparison rather than logical combination. Assignment Operators (Option D) simply assign values to variables without performing any evaluation or returning a result type. Therefore, only Logical Operators specifically perform logical operations that combine Boolean operands to produce a final Boolean outcome.