i would be grateful if somebody could help me with this problem. The book I am currently reading has a question
Q What will be the output?
#include <stdio.h>
void main()
{
int a = 3, b = 2;
a = a ==b==0;
printf("%d, %d",a,b);
}
The answer is given as 1,2 ( even on codeblocks got the same answers) Now i understand that equality operator has precedence over the assignment operator. So it must be a== b or b == 0 first Then as both the above have the same operator, The associativity rule causes a == b to be evaluated first. But from here on I am lost! How does one get to 1 and 2 as the answer?