I have a problem understanding code output. Any explanation please ...
#include<stdio.h>
void main()
{
int x=2,y=5;
x*=y+1;
printf("%d",x);
}
The output is 12. But according to my understanding, x*=y+1;there is x=x*y+1;, but in accordance with the priority of the operator, x*yit should be evaluated, and then adding 1, therefore, it should be 10 + 1 = 11. But this is 12 - can someone explain please?
source
share