+ 3
Why does 10|20 = 30 ?
When I search for an explanation of this operator on the internet, all I find is “Bitwise OR”. Any help? Thanks!
7 odpowiedzi
+ 14
Here you go!
https://www.sololearn.com/learn/4073/?ref=app
+ 12
bitwise OR will operate on binary representation of the numbers on both sides and perform a "logical OR" operation on each bit
10 = 01010
20 = 10100
---------------
10|20 = 11110
which converts to 30 in binary number system
+ 4
Ad Lo first learn how to convert decimal numbers to binary numbers.
+ 2
Kumary Harini do not spam here !
+ 1
Sonic Thanks! Yes, the conversion from decimal to binary is what I have not yet memorized and is where my difficulty with Bitwise begins.
- 4
'hello world'