i thgink the answer should be:
 
4 5 5 4 5.
any way isn't it the answer?

ashwin mittal <[EMAIL PROTECTED]> wrote:


--- [EMAIL PROTECTED] wrote:

>
>
> --- In [EMAIL PROTECTED], srikanth
> poojary
> <[EMAIL PROTECTED]> wrote:
> > main()
> > {
> > int i=5;
> > printf("%d%d%d%d%d",i++,i--,++i,--i,i);
> > }
> >
> > 
> > what is the o/p and why?
>
> Output may be anything and it would be correct. See:
> <http://www.eskimo.com/~scs/C-faq/q3.1.html> and the
> next few questions.
>
>
>
Hi all,

The Printf _expression_ is compile from Right to left...
So starting from right,
i,
--i,
++i,
i--,
i++
the sequence goes like this....

So
i = 5;
--i = 4;
++i = 5;
i-- = 5;
i++ = 4


But the printf will display the output in that
sequence in which it is demanded...
i.e. from left to right...

i++,
i--,
++i,
--i,
i


Accordingly the values are displayed as such...
i.e
4 5 5 4 5


Regards,
Ashwin Mittal.


           
__________________________________
Do you Yahoo!?
Send a seasonal email greeting and help others. Do good.
http://celebrity.mail.yahoo.com





To unsubscribe : [EMAIL PROTECTED]





Do you Yahoo!?
The all-new My Yahoo! � What will yours do?

To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to