- 3
What IS "&&"!!??
Can't understand how is it used
4 Answers
+ 2
Logical AND operator: returns true only if both operands are true
+ 2
&& = and
if (2 > 1 && 5 > 3) { // if they both 2 > 1 and 5 > 3 are true then will print hey thats what && does if first condition AND second condition are true do that else do other thing
cout << "hey";
}
else {
cout << "bye";
}
+ 1
whenever you have multiple conditions to check and you wants to execute the code when all conditions are true then you use && operator. And || operator is used one only one of those condition is true.
0
tests if two conditions are equal