Why is a condition like (0 < a < 5) always true?
Unlike Python (which has operator chaining), C evaluates the condition as: (0 < a) < 5 The result of (0 < a) is either 0 or 1, both of which are less than 5, so the overall condition is true. In C, a range test must be written: 0 < a && a < 5 … Read more