I am learning C. I came across the following program -
#include <stdio.h>
int main() {
int var1 = 2, var2 = 6;
var2 = var2 || var1++ && printf("Computer World");
printf("%d %d\n", var1, var2);
return 0;
}
After compilation with gcc 4.4.5 on Ubuntu 10.10, I'm getting the output as -
2 1
I understand how 'var2' is set to 1.
Even thought there is a increment operator on 'var1', why it is not incremented when we see the console output?