No chance both the printf will print '6' only.....
[mod - I think you'll find that the OP was assuming one of the printf() would
be executed - not both in order which is what you're assuming - PJH]
-----Original Message-----
From:
[EMAIL PROTECTED] com [mailto:c-prog@ yahoogroups. com] On Behalf Of
sharma_anish9188
Sent: Sunday, February 04, 2007 8:09
PM
To: [EMAIL PROTECTED] com
Subject: [c-prog] help in
the logic
I cant understand the logic
can anybody help me to under
stand
int i=5;
printf("%d", ++i); = 6
printf("%d", i++);
= 5
how?
[mod - I assume you mean only one of those printf()'s,
not the two in series as you've presented it -
-------------------------------------------------------------------------------------------------
becoz ++a mean pre increment so it will increment then it will print ,but
whereas a++ is post increment so it will print the current value then it will
increment.......
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com