No, it is clearly defined. It just differs from semantics in what you expect.
The expression is evaluated as follows:
if (((a[0] < a[1]) < a[2]) < a[3]) {
Each comparison gives a boolean result ( 0 or 1 ).
The result (boolean) of a[0] < a[1] compared with a[2] , and the (logical) result of this comparison is compared with a[3] .
I'm sure there are some legitimate use cases, but they are rare at best.
The right way to express what you are trying to express is
if (a[0] < a[1] && a[1] < a[2] && a[2] < a[3]) {
source share