@Anatony the output will be compiler dependent res1 is not defined .. as C don't allow to change the value of a variable more than once between a sequence point.. A sequence point occur while assigning a value , calling a function or returning from it.. Hence both res1 and res2 would give arbitary results..
On Sat, Jul 16, 2011 at 1:45 AM, Antony Kotre <antonyko...@gmail.com> wrote: > can any tell and explain the output of following code > > #include<stdio.h> > main() > { int a =5, b=5; > int res1=(++a)+(++a)+(++a); > int res2=(++b)+(++b)*10+(++b)*100; > > printf("%d\n%d\n",res1,res2); > } > > -- > 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.