+ 1
Pls explain this question
print (12 & 20) I got 4 output why??
2 Antworten
+ 6
'&' symbol represent the bitwise and operation. So you have to convert 12 and 20 to binary to get the output.
12- 00001100
20- 00010100
12 & 20- 00000100
0 & 0 --->0
1 & 1 --->1
1 & 0 --->0
Then convert 00000100 to decimal. It is equal to 4.
+ 2
https://www.sololearn.com/learn/4072/?ref=app
See this I think this would help