Its due to order of evaluation of of parameters passed to printf..
 
However, it is compiler dependant. And the behaviour of program is undefined.
 
Check this: http://www.scit.wlv.ac.uk/cbook/chap3.order.html
 
Cheers,
Amol
-----Original Message-----
From: Himanshu Arora [mailto:[EMAIL PROTECTED]
Sent: 26 October 2004 15:41
To: [EMAIL PROTECTED]
Subject: (PT) Check this Program!


#include<stdio.h>
int  main()
{
      int i=0;
      printf("%d ,%d ,%d\n",i,i++,i++);
      return 1;
}
Output:
2 ,1, 0

Please tell me why the output of this program is like this.

Bye
Himanshu





To unsubscribe : [EMAIL PROTECTED]






To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5526708.6599542.3001176/D=groups/S=:HM/A=2372354/rand=265443568


Yahoo! Groups Links

==============================================================================
This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

Reply via email to