1 votes 1 votes What is the logic behind this code. #include <stdio.h> void main() { int x; x = 3 > 2 > 1; printf("%d", x); return; } `JEET asked Dec 26, 2018 `JEET 299 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Abhisek Tiwari 4 commented Dec 27, 2018 reply Follow Share 0?? from prog debugg i understood that x=3>2 --------1 and 2>3 is 0 similarly x=3>2>1---(3>2)>1----1>1==0 it just check and return 0 or 1 see this @Magma 0 votes 0 votes `JEET commented Dec 27, 2018 reply Follow Share Yes 0 is the answer. 0 votes 0 votes register_user_19 commented Dec 27, 2018 reply Follow Share > is left to right associativity, x=3>2>1 means, x=(3>2)>1 as 3 is greater than 2, 3>2 return true or 1 so it become x=1>1; false or 0, x become 0 0 votes 0 votes Please log in or register to add a comment.