-
-
-
}">What is the output of the following program?main() { int i=-1,j=-1,k=0,l=2,m; m=i++ && j++ && k++ | | l++; printf("%d %d %d %d %d",i,j,k,l,m); }
The output is 0 0 1 3 1This is as followsFirst the expression gets reduced asm = -1 && -1 && 0 || 2This is because ++ gets the higher precedence and being postfix operator it is first applied to expression and then only incremented. Now in this Logical AND gets higher precedence over Logical OR and the associativity or the order in which Logical AND as well as Logical OR gets executed is left to rightSo...
-
-