You are viewing a single comment's thread. Return to all comments →
That's because (( .. )) deals with only arithmetic operations, hence, is expected to give wrong results here.
If the value of expression inside double-parentheses evaluates to zero, only then it is considered as false (otherwise true).
Though, both the statements would have worked correctly if we were dealing with integers instead of alphabets (i.e. n,N,y,Y).
Seems like cookies are disabled on this browser, please enable them to open this website
Getting started with conditionals
You are viewing a single comment's thread. Return to all comments →
That's because (( .. )) deals with only arithmetic operations, hence, is expected to give wrong results here.
If the value of expression inside double-parentheses evaluates to zero, only then it is considered as false (otherwise true).
Though, both the statements would have worked correctly if we were dealing with integers instead of alphabets (i.e. n,N,y,Y).