Re: [algogeeks] need explanation of this c code

2011-09-04 Thread sukran dhawan
order of evaluation for such expressions is not defined in standard c.it is compiler dependent./ is not sequence point On Sat, Sep 3, 2011 at 11:05 PM, vivek goel vivek.thapar2...@gmail.comwrote: firstly ++i will be evaluatedso i=6 then expression will be i=6/6; so now i

[algogeeks] need explanation of this c code

2011-09-03 Thread sinjanspecial
code:- void main() { int i=5; i=(++i)/(i++); printf(%d,i) } Output is 2 plz explain how it is? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group,

Re: [algogeeks] need explanation of this c code

2011-09-03 Thread vivek goel
firstly ++i will be evaluatedso i=6 then expression will be i=6/6; so now i will be equal to 1.. after the expression will be evaluated i++ post increment will work since, post increment works only if a semi-colon occurs or comma operator occurs. so now i will increment

Re: [algogeeks] need explanation of this c code

2011-09-03 Thread sukran dhawan
its compiler dependent On Sat, Sep 3, 2011 at 10:59 PM, sinjanspecial sinjanspec...@gmail.comwrote: code:- void main() { int i=5; i=(++i)/(i++); printf(%d,i) } Output is 2 plz explain how it is? -- You received this message because you are subscribed to the Google Groups Algorithm