+ 1
Why is the output of the following C code 10 41 ?
int main() { int e=5,f=0; f=(++e) + (++e) + (++e) + (++e) + (++e); printf("%d %d\n",e,f); return 0; } It should be 10 40 but it's coming out to be 10 41.
1 Réponse
+ 1
Using ++ operator more times in single line is UNDEFINED. You never know what will come up, depends on compiler or compiler flags