what is the difference between "|" and "^" ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

what is the difference between "|" and "^" ?

14th Aug 2018, 4:31 PM
Real Gutch
Real Gutch - avatar
3 Answers
+ 11
XOR means exclusive OR. so only one of the two inputs should be 1. 1 ^ 0 = 1 0 ^ 1 = 1 0 ^ 0 = 0 1 ^ 1 = 0 While | is just OR. So _atleast_ one input should be 1.
14th Aug 2018, 5:39 PM
Yash✳️
Yash✳️ - avatar
+ 5
😄
14th Aug 2018, 4:48 PM
Real Gutch
Real Gutch - avatar
+ 1
Or, exponent of, xor.
14th Aug 2018, 6:36 PM
Asim Farheen
Asim Farheen - avatar