Int x=1-(-1==~0); | Sololearn: Learn to code for FREE!


Int x=1-(-1==~0);

Explain this pls

10/15/2019 1:03:31 PM


3 Answers

New Answer


~ is a bitwise complement operator. If you don't know how it works then please read it here == is an equality operator, judging by your course progress, i think you have covered "==" (equality operator) so you should be knowing how it works. If you don't remember please revise. Once you are though this stage you will know what is the answer. I can give you an answer but please try first.


You can simply write a program, execute it and you will know the answer. Don't get me wrong but this should come to you naturally that you can always write a program and execute it to find the answer. Ideally your question should have been why the output is, what it is, instead of what is the output.


~ swim ~ what will be the answer of that code??.... That u tell me