posted 18 years ago
Hi All,
When I do workout on the below program
It gave me result 121.My way of working logic is
i=0
a=0
i=i++ i take this like
i=i=i+1
i=0(i is incremented 1 here)
then,when we come to print i,it will print i=0
a=i++; I take this like
a=i=i+1
a=1 ,i=1+1(why am I taking like this means that I value is assigned to new variable a.so I took this statement as two(a=1,i=2).
When we come to print i,a=it prints 2,1
So my calculated output is 021.But when I run this program it gives the result 010.Can someone please explain that in my way of understanding.
Thanks in advance.