Negation zero _ if condition | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Negation zero _ if condition

https://code.sololearn.com/cxsbqpJwBSbn/?ref=app Hi friends.. here I am getting output as no .......but ~0=1 . So (~0==1 ) I think this statement is true na. Then why it's getting false....? Could you explain...?

9th Jun 2019, 5:33 AM
malepu rakesh
malepu rakesh - avatar
2 Answers
+ 7
malepu rakesh You might be confusing ~ and ! (bitwise not vs. logical negation) ==> (!0 == 1) // true
9th Jun 2019, 6:33 AM
Anna
Anna - avatar
+ 2
Thank you friends😊
9th Jun 2019, 6:47 AM
malepu rakesh
malepu rakesh - avatar