the output is 22 13 13 as increment and decrement operators associate from right to left hence first ++a will be evluated which makes a=11 then a++ is evaluated as its a postfix operation hence b=a+a=11+11=22 and after this a =12 then in printf statement again right associativity follows hence ++a sets a=13 and the output is 22 13 13
On Sat, Feb 5, 2011 at 2:04 AM, aniket chatterjee <aniket...@gmail.com>wrote: > The answer will be compiler dependent.Google "Sequence Point in C". > > -- > 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, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.