Here is the code
int main()
{
int x=15;
printf("%d %d %d %d",x=1,x<20,x*1,x>10);
return 0;
}
And output is 1 1 1 1
I was expecting 1 1 15 1
as output,
x*1
equals to 15
but here x*1
is 1
, Why ?
Using assignment operator or modifying value inside printf()
results in undefined behaviour
?