- 3

What IS "&&"!!??

Can't understand how is it used

28th Jan 2017, 6:45 AM
maxxxim
maxxxim - avatar
4 Answers
+ 2
Logical AND operator: returns true only if both operands are true
28th Jan 2017, 6:49 AM
Jafca
Jafca - avatar
+ 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"; }
28th Jan 2017, 6:49 AM
Kawaii
Kawaii - avatar
+ 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.
28th Jan 2017, 7:12 AM
Shahood Hussain
Shahood Hussain - avatar
0
tests if two conditions are equal
28th Jan 2017, 7:53 AM
Andre van Rensburg
Andre van Rensburg - avatar