int a = 5;
int b = ++a * a++;
(a) 25 (b) 30 (c) 36 (d) Undefined Behavior
according to the standards of C
b = ++a * a++;
a=a++; are undefined
Ans should be D) Undefined Behavior
as here variable n is modified multiple time and not any intermediate sequenced .so it gives undefined behavior .
you can refer here also : http://gatecse.in/wiki/Undefined_Value
yes , different compile give different values .
"Undefined value means compiler can give any value. i.e.; different compilers or even different versions of the same compiler can give different answers. As per C standard, no programmer should write this code. This is different from compiler defined, in which case the output is clearly defined by the compiler and programmer can write those code as long as he is aware of the compiler