0
#include <stdio.h> int main() { int x=12 , y=15 , z=20; if(x>y<z) printf ("red"); else printf ("green"); return 0; }
Any one can suggest how it's out put come red.
5 odpowiedzi
+ 1
x>y<z
// x is NOT greater, so it breaks down to 0
0<z
//0 is less than 20 so it passes
+ 2
Slick isn't it checking from right to left?
I think y<z=1(true) so x>1 and we get the same result. But I may be wrong
+ 1
Michał Doruch Yeah, i think you're right! That's my mistake in the order of operations