#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = x && y || z++;
printf("%d", z);
}
On executing, the following program gives output as 6 which is expected. But this program
#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = x && y && z++;
printf("%d", z);
}
gives output as 5. Can anyone explain this output. I have good understanding of pre-increment and post-increment operator but couldn't able to figure out this output.