Two ‘==’ equality operators in same ‘if’ condition are not working as intended
if ( (i == j) == k ) i == j -> true -> 1 1 != 123 To avoid that: if ( i == j && j == k ) { Don’t do this: if ( (i==j) == (j==k)) You’ll get for i = 1, j = 2, k = 1 : if ( … Read more