+ 1
What is the diiference between && and // operator ?
4 odpowiedzi
+ 3
See the difference in truth table below.
P Q P && Q P || Q
T T T T
T F F T
F T F T
F F F F
T = true
F = false
P || Q will false only if both P and Q are false
P && Q will true only if both P and Q are true
+ 1
&& means and, while || means or. So ask yourself, do you want a code to be complete if two statements match up, or if at least one statement meets your conditions.
+ 1
&& means and, // is comments, and || means or.
0
single ampersand(&) and single (|)pipeline character operators are known as bitwise operators and double && and || are known as AND or OR operators
working
both operators require two conditions for && operator result will be true when both conditions are true if either condition is false it will result FALSE but in case of it will result true if either condition is true nd it results false only when both conditions are false
if(a>3&& b <9)
in this case if any condition is not satisfied then it will result false if both conditions are true then it will result true