+ 1
|| and &&
meaning. I've just completed a challenge In C++ and the questions contanis && and || operators. but i didn't see them yet in my course. i supouse the || is different and && is AND
4 Answers
+ 10
|| is OR
&& is AND
+ 4
|| is or
&& is and
For example:
if(a==2 || b==3) {
cout << "Hello" << endl;
}
this will print Hello when a=2 OR b=3
if(a==2 && b==3) {
cout << "Hello" << endl;
}
this will print Hello only when a=2 AND b=3
+ 4
in || any of condition must be true and in && both must be true to give true
+ 1
Got it! Thanxs guys.