Explanation:
Operator Description Example
&& Called Logical AND operator. If both the operands are non-zero, then the condition becomes true. (A && B) is false.
|| Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true. (A || B) is true.
Logical operators:
1 . result = a || b;
2 . result = value1 || value2 || value3;
3 . result = a && b;
4 . result = value1 && value2 && value3;
5 . result = ! value;
Copyright © 2024 EHUB.TIPS team's - All rights reserved.
Answers & Comments
Explanation:
Operator Description Example
&& Called Logical AND operator. If both the operands are non-zero, then the condition becomes true. (A && B) is false.
|| Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true. (A || B) is true.
Explanation:
Logical operators:
1 . result = a || b;
2 . result = value1 || value2 || value3;
3 . result = a && b;
4 . result = value1 && value2 && value3;
5 . result = ! value;