answer is 17............i got in gcc comp On Sun, Nov 7, 2010 at 7:23 PM, Piyush <[email protected]> wrote:
> C standard says that between two sequence points object's stored value can > be modified only once ( by evaluation of expression), > A sequence point occurs in following conditions: > 1. at the end of full expression. ( the case for your answer) > 2. at the && , || , ?: operators > 3. at a function call (after the evaluation of all arguments i.e just > before the actual call) > > Since the value of your variable is getting modified more than once between > the two sequence points the result is undefined. > > > On Sun, Nov 7, 2010 at 5:33 PM, siva viknesh <[email protected]>wrote: > >> i compiled .. the answer is 17 !! ... its 5+5+7 ..evaluate from left >> to right >> >> On Nov 6, 8:42 pm, bipul21 <[email protected]> wrote: >> > #include<stdio.h> >> > int main() >> > { >> > int a=5; >> > a=a+(a++)+(++a); >> > printf("%d",a); >> > return 0;} >> > >> > answer is 19 but how?? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<algogeeks%[email protected]> >> . >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
