Re: [algogeeks] Re: how this output is obtained ?

2011-07-19 Thread DeVaNsH gUpTa
@Vengadanathan: I think you should see this link http://c-faq.com/expr/seqpoints.html -- Thanks and Regards *Devansh Gupta* *B.Tech Third Year* *MNNIT, Allahabad* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Re: how this output is obtained ?

2011-07-19 Thread Abhi
@Devansh: Nice post.. Regards, Abhishek Khattri -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/r4Gbsw08bI0J. To post to this group, send email to

[algogeeks] Re: how this output is obtained ?

2011-07-18 Thread kaustubh
z is equal to 6 as both are post increment. However, if one of these was pre-increment, output would have been undefined. On Jul 19, 9:39 am, sagar pareek sagarpar...@gmail.com wrote: you are using post increment which increments th evariable in next line :) (except for the case of printf();

Re: [algogeeks] Re: how this output is obtained ?

2011-07-18 Thread sagar pareek
z=++x+x++ //with x=2 gives z=6 and x=4 On Tue, Jul 19, 2011 at 10:32 AM, rogu3 manikanta...@gmail.com wrote: i think ++x+x++ works fine. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Re: how this output is obtained ?

2011-07-18 Thread saurabh singh
Your answer lies in the above few posts:) On Tue, Jul 19, 2011 at 10:37 AM, sagar pareek sagarpar...@gmail.comwrote: z=++x+x++ //with x=2 gives z=6 and x=4 On Tue, Jul 19, 2011 at 10:32 AM, rogu3 manikanta...@gmail.com wrote: i think ++x+x++ works fine. -- You received this message

Re: [algogeeks] Re: how this output is obtained ?

2011-07-18 Thread sagar pareek
what?? On Tue, Jul 19, 2011 at 10:39 AM, saurabh singh saurab...@gmail.com wrote: Your answer lies in the above few posts:) On Tue, Jul 19, 2011 at 10:37 AM, sagar pareek sagarpar...@gmail.comwrote: z=++x+x++ //with x=2 gives z=6 and x=4 On Tue, Jul 19, 2011 at 10:32 AM, rogu3

Re: [algogeeks] Re: how this output is obtained ?

2011-07-18 Thread saurabh singh
pre increment x becomes 3 then post increment x remains 3 gives z the value 6.When this thing done increases x to4. Though all examples given above are undefined(and total crap) as per C is concernd.So don't mind if you see a compiler produces an assembly code that crashes ur computer on writing