#include <stdio.h>
int main() {
int num1,num2,num3;
scanf("%d %d %d",&num1,&num2,&num3);
if(num1<num2<num3){
printf("YES");
}
return 0;
}
This code reads three integers and attempts to check if they are in strictly increasing order. The condition `num1<num2<num3` does not work as intended in C because comparisons are evaluated left to right, so `num1<num2` produces either 0 or 1, which is then compared to `num3`.
- The expression `num1<num2<num3` is evaluated as `(num1<num2) < num3`. The first comparison yields 0 or 1, and then that value is compared to `num3`. This is not a three-way comparison.
- To check if all three numbers are in increasing order, you need to combine two separate comparisons using the logical AND operator (`&&`).