in Programming in C edited by
952 views
0 votes
0 votes

i am getting 12 please check it

in Programming in C edited by
952 views

4 Comments

yeah right

it's totally compiler dependent

0
0

Though I have executed the program still my concern is that this statement, x = x + fun(&x);

x is already assigned with 3 as the input and fun have returned 4. So, the output should be 7. I know that the output is coming to be 12 by executing. 

Is it like the right to left or left to right assignment kind of thing?

@Magma @Prince Sindhiya

0
0

@`JEET your output is 12 because your compiler is using right to left order of evaluation. In C there is no specified order of evaluation, depends on the compiler and order of evaluation and assignment are two different things.

0
0

Please log in or register to answer this question.

Related questions