Strange processing!!

anuj gupta <[email protected]> Fri, 10 Mar 2006 08:43:41 +0000 (GMT)
Newsgroups gmane.comp.programming.cppug
Message-ID <[email protected]>
Hi All,
This is Anuj,an MCA std from India.
I tried the following 2 progs, both resulted in
different outputs. But i don't understand the REASON
behind them. 

1. 
int a=5, b = ++a + ++a + ++a;
printf("%d",b);
OUTPUT :- 21

2.
int a=5, b;
b = ++a + ++a + ++a;
printf("%d",b);
OUTPUT :- 54

Even if i use Macro expansion instead of writing the
whole expression, even then the result is same.
If anyone out there can help me out it'll be a big
help.Thank you.


		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cppug/

<*> 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/