Review the lesson on conditional chapter please. This is C not Python
if(a < b < c)
Is different with
if(a < b && b < c)
Once you understand how each of the above expressions were evaluated, you'll get the idea about the output.
I lost you at the "90% codes this method is correct" I don't get what you mean.
My idea of the evaluation:
if ( (a < b) < c )
if ( (40 < 20) < 80 )
if ( ( 0 ) < 80) )
If ( 1 )
But considering C doesn't support operator chaining like Python, I don't have any guarantee.
Multiple expression should have explicit intermediary operator in between to be clearly readable and safe.
if ( a < b && b < c )
if ( a < b || b < c )
Something like that ...
I only added the parentheses to emphasize/clarify the priority for evaluation buddy.
I am not supporting nor encouraging such way of writing expression, it is okay if you do that in Python, but there are differences in C. If possible, just don't write that way in C 👌
First of all,
1. Start with C programming.
2. Get knowledge as well as logic of maths.
3.Solve C tutorial of C programming, varnish your knowledge through it.
4.Then, try to solve challenges on sololearn, hackerearth and so many platforms.