i=-3 it gets incremented to -2 (++i) m is evaluated and as ++i is non zero it evaluates to TRUE and m is assigned value 1, hence remaining part is not executed , so j and k is not incremented.
On Tue, Jun 12, 2012 at 2:19 AM, Dave <dave_and_da...@juno.com> wrote: > This is the result of short-circuit evaluation. See, e.g., > http://en.wikipedia.org/wiki/Short-circuit_evaluation, or this topic in > your language reference. > > Dave > > On Monday, June 11, 2012 2:28:52 PM UTC-5, ((** VICKY **)) wrote: > >> #include<stdio.h>int main(){int i,j,k,m,l; >> i=-3; >> j=2; >> k=0;m=++i || ++j && ++k ;printf >> <http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("\n%d >> %d %d %d",i,j,k,m);return 0;} >> >> o/p: -2 2 0 1 >> >> >> k should be 1 right???? >> >> >> -- >> Cheers, >> >> Vicky >> >> -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/8PoAya7NqjYJ. > > 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.