Boolean logic | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Boolean logic

What's the difference between & and "and" and between | and "or" ?

16th May 2018, 1:27 PM
Wolfysta - avatar
4 Answers
+ 4
and(&) will be true if both statements are true. or(|) will be true is either of statements is true.
23rd May 2018, 1:24 AM
Vijay Kumar Kanchukommala
Vijay Kumar Kanchukommala - avatar
+ 2
hi, Logical ( and &):- it multiplies var a with var b to check the result out. Logical ( or |):- it adds var a with var b to check the results.
16th May 2018, 1:38 PM
+ 1
thx ^^
16th May 2018, 4:41 PM
Wolfysta - avatar
its same as it used in AND Gate ( truth table) OR Gate ( truth table) single operators are known as bitwise and , or double operators are known as logical and,or
16th May 2018, 1:40 PM