Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by Kruti Patel for Java not reading "&&" statements properly?

1 % 2 == 12 % 2 == 0-2 % 2 == 0-1 % 2 == -1

Here, -1%2 does not results in 1. Hence, it will not increment value of negodd variable.

In JAVA, negative number modulo will give same result as positive number modulo but with a negative sign. 0 is neutral thus it will not have any sign.


Viewing latest article 1
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>