Actually i had evaluated x=(++i + ++i); separately with i=2; but i was amazed to get answer as 8... can u elaborate it
On Mon, Feb 13, 2012 at 4:09 PM, Rahul <raikra...@gmail.com> wrote: > Here you go then : > ++ i becomes 3 > second bracket becomes 5 ( 3+2) > > > first bracket is 4 > > 4 * 5 = 20 > But you are adding ONE to i FOUR times > hence the answer you get is 4 plus the computation of previous line > > Hope I AM correct : > > > > > On Mon, Feb 13, 2012 at 3:56 PM, Ratan <success.rata...@gmail.com> wrote: >> >> can any1 explain the working of the above expression in any of the >> compiler..... I jzz want to knw how the computation takes place in gcc >> compiler.. >> >> On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan <kartik.sac...@gmail.com> >> wrote: >> > its a compiler depentent... >> > >> > -- >> > 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. >> >> >> >> -- >> -- >> Ratan | 3rd Year | Information Technology | NIT ALLAHABAD >> >> -- >> 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. >> > > -- > 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. -- -- Ratan | 3rd Year | Information Technology | NIT ALLAHABAD -- 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.