OK, maybe I got it!
You have made the add operation absent partly.
I have change the code as followed:
int x=1;
for(int i=1,m=9;++i<4;)
for(int j=1;j<4;j++)
for(int k=1;k++<4;)
{
if(i==3)
m=++m+1;
else
m--;
printf("%i\n",m);
}
the output:87654321024681012141618
for I use the "printf" instand of the "cout", the first num is 8 not 9(easy to
make that printf from 9, i think).
In my mind, the absence of "=" occured the "+1" operation no effection, and
with the code, which has been verified.
thanks.
--- In [email protected], Asad Abbas <cyberstuden...@...> wrote:
>
> Consider the following code
>
> ?main()
> {
> for(int i=1,m=9;++i< 4;)
> for(int j=1;j<4;j++)
> for (int k=1;k++<4;)
> cout<<(i==3? ++m+1:m-- );
> getch();
> }
>
> Its output: (on Dev C++)
>
> 9876543212345678910
>
> ---
>
> I could not understand when 'i' is not equal to 3 'm--' is executed so value
> of m is decremented by '1' (thats right)
> But when i==3 and ++m+1 is executed then why the value of m is incremented by
> 1 only?
> (++m+1) This should increment the value of m by 2 :(
> ?> ---
> ?> Where am i Wrong?
>
> Thanx in advance!
>
> Regards!
> Asad Abbas
> Pakistan
> ---
>
> For latest technology news
> visit
> http://latest- technologies. tk/
> To keep urself updated with changing world!
>
>
>
>
> [Non-text portions of this message have been removed]
>