RE: could any one explan me what happens in this progr...
The output of this program will be undefined. In C and C++, if you read a variable twice in an expression where you also write it, the result is undefined.for further details : http://www.research.att.com/~bs/bs_faq2.html#evaluation-order
RE: could any one explan me what happens in this program. main(){ int i=10; i=(++i)/(i++); printf("i=%d",i); }
1. i ++ will get execute so the value will be 10 . it wont increment. 2. ++i will be incremented to 11 3. 11/10 will result to 1 4.i=1 will get execute. 5. keep in mind still increment is not done.. this is done after exectuing , or ; 6. after executing i=1 ';' will be executed 7. i++ will get incremented to 2