The following code prints 0 to the screen. I swear it should be 1, what am I missing?
k = i shifted left by j, since i is zero this is 0 + j shifted left 0 times, since j is 1 this becomes 0 + 1
k = i shifted left by j, since i is zero this is 0 + j shifted left 0 times, since j is 1 this becomes 0 + 1
Code:
int main(void) {
int i = 0, j = 1, k;
k = i << j + j << i;
printf("%d",k);
return 0;
}