--- [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
------------------------ Yahoo! Groups Sponsor --------------------~-->
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~->
To unsubscribe : [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To reply to this message, go to:
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4817
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Programmers-Town/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/