2 votes 2 votes #include <stdio.h> int main() { int x=1,y=0,z=5; int a=x && y && z++; printf("%d",z); } The output is 5, can someone explain how? Programming in C programming-in-c + – A_i_$_h asked Jul 7, 2017 • edited Jul 7, 2017 by dd A_i_$_h 2.3k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 6 votes 6 votes && is left associative precedence of ( post increment )++ is more than && (logical AND ) dd answered Jul 7, 2017 • selected Jul 8, 2017 by dd dd comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes In final statement(printf), its printing the value of variable z i.e. 5. Therefore, output will be 5. targate2018 answered Jul 7, 2017 targate2018 comment Share Follow See all 0 reply Please log in or register to add a comment.