I have the following program:
#include <stdio.h>
int main ()
{
int x = 8;
printf("%d %d %d ", x++, x << 2, x >> 1);
}
The way I feel like this is supposed to go is this way: The first number should be 8. Then it gets incremented to 9. 9<<2 is 36 so the second %d is 36. The last one is 8 >> 1 which is 4.
However, when I put this into the compiler I get '8 32 4' and not '8 36 4'.
Can someone explain why please?
Thank you!