Which operator is used for 'logical AND' in C?
A. &&
B. ||
C. &
D. |
Answer: Option A
Solution (By Examveda Team)
The operator used for 'logical AND' in C is Option A:&&
. The &&
operator is used to perform a logical AND operation, which returns true if both of its operands are true, and false otherwise.So, the correct answer is:
Option A:
&&
Here's an example of using the logical AND operator in C:
if (x && y) {
// Code to be executed if both x and y are true
}
In this example, the code within the if statement will be executed only if both 'x' and 'y' are true.
Join The Discussion