I was going through a C objective book where a question comes:
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k;
i=j=k=1;
k=++i||++j&&++k;
printf("%d %d %d",i,j,k);
return 0;
}
The output is:
2 1 1
In my view:
k
is incremented.j
is incremented.i
is incremented.k&&j
will happen.i|| (k&&j)
So the output should be i=2
,j=2
,k=1
. What am I missing?