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

+1

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

Explain this pls

10/15/2019 1:03:31 PM

Shaziya

3 Answers

New Answer

+4

~ is a bitwise complement operator. If you don't know how it works then please read it here https://www.sololearn.com/learn/4076/?ref=app == 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.

+2

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.

+1

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