so many times such questions have come....... behavior is entirely compiler
dependent
if you are preparing for interviews then believe me no one in the whole
world will ask such questions to you. there's no point discussing it....

On Fri, Jul 22, 2011 at 8:15 PM, Gaurav Popli <[email protected]> wrote:

> may be im wrong....but i read it somewhere about it...the arguments of
> a function are evaluated in a associativity that is compiler
> dependent...
>
> for ex...
>
> printf("%d  %d  %d" ,fun1(),fun2(),fun3());
> the order in which functions are evaluated are compiler dependent....
>
> On Fri, Jul 22, 2011 at 7:20 PM, Abhinav Verma
> <[email protected]> wrote:
> > Its not the associativity which is undefined (Associativity has been
> defined
> > clearly by the C Standards for each and every operator). Its the order of
> > evaluation between 2 sequence points which is undefined and hence
> > compiler-dependent.
> > On gcc version 4.4.3, output generated is 5551. On some other compiler,
> the
> > output may differ.
> >
> > On Fri, Jul 22, 2011 at 6:09 PM, Gaurav Popli <[email protected]>
> wrote:
> >>
> >> associativity rule is compiler dependent ...thats why undefined...
> >>
> >> On Fri, Jul 22, 2011 at 5:46 PM, Kamakshii Aggarwal
> >> <[email protected]> wrote:
> >> > undefined behaviour.
> >> > since value of i is changing more than once between two sequence
> >> > points..
> >> > On Fri, Jul 22, 2011 at 5:42 PM, suresh srinivasan <
> [email protected]>
> >> > wrote:
> >> >>
> >> >> Output:
> >> >> 5,4,3,1
> >> >>
> >> >> Explanation:
> >> >> Since the brackets acts as right precedence, the execution of the
> >> >> statement is from right to left. The comma separates the individual.
> >> >> For i++, it prints the current 'i' value and increments it by 1.
> >> >> For ++i, it increments the value by 1 and prints the updated value of
> >> >> 'i'.
> >> >> --
> >> >> Regards,
> >> >> Suresh.S
> >> >>
> >> >> --
> >> >> 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.
> >> >
> >> >
> >> >
> >> > --
> >> > Regards,
> >> > Kamakshi
> >> > [email protected]
> >> >
> >> > --
> >> > 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.
> >> >
> >>
> >> --
> >> 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.
> >>
> >
> > --
> > 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.
> >
>
> --
> 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.
>
>

-- 
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.

Reply via email to