We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
your program is correct but how i am not able to understand the logic behind this
if ((B<0 && H<0)&&(B>=0&&H>=0))
suppose :we will give input 1and 3 then it shoud go to false block
because
B<0 && H<0 =false
B>=0&& H>=0=True
false && true
false should come
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Static Initializer Block
You are viewing a single comment's thread. Return to all comments →
your program is correct but how i am not able to understand the logic behind this if ((B<0 && H<0)&&(B>=0&&H>=0)) suppose :we will give input 1and 3 then it shoud go to false block because B<0 && H<0 =false B>=0&& H>=0=True false && true false should come