I run the following C program
#include <stdio.h>
int main() {
int x = 5, y = 6, z = 3, i;
i = y > x > z;
printf("%d\n", i);
}
and get the output as 0
.
Again, when I run
#include <stdio.h>
int main() {
int x = 5, y = 6, z = 3, i;
i = y > x && x > z;
printf("%d\n", i);
}
I get output as 1
. Can anyone explain the logic behind this?