I have doubts about the program below.
int main() { int i = -3,j = 2, k = 0,m; m = ++i || ++j && ++k; printf("%d %d %d %d\n", i, j, k, m); return 0; }
I get output as -2 2 0 1 .
In the OR operation, if the first value is true, it will not evaluate the second, therefore i = -2 and j =2 . Then operation I. is performed. It will check that both values ββare true. Therefore, if k = 1 , then m = 1 . Thus, the output should be -2 2 1 1 . I run and check and get the output as -2 2 0 1 , but I could not figure out how to do this.
source share