ashishchaudhary

09-24-2011, 08:32 AM

hello Every one,

Today my problem is much complex for me, I am so confused why is this happening;

The problem is

if i have a = 2;

********** In C Language **********

and i perform

i = a++ + ++a + --a + a-- + ++a;

then result is = 15

i = a++ + ++a + --a + a--;

then result is = 8

************ In Java Language ************

i = a++ + ++a + --a + a-- + ++a;

then result is = 15

i = a++ + ++a + --a + a--;

then result is = 12

I don't know why is this happening, what is the reasion, I am performing the same operation but the result is different.

Please give me the detail description about this.

Thank You.

Today my problem is much complex for me, I am so confused why is this happening;

The problem is

if i have a = 2;

********** In C Language **********

and i perform

i = a++ + ++a + --a + a-- + ++a;

then result is = 15

i = a++ + ++a + --a + a--;

then result is = 8

************ In Java Language ************

i = a++ + ++a + --a + a-- + ++a;

then result is = 15

i = a++ + ++a + --a + a--;

then result is = 12

I don't know why is this happening, what is the reasion, I am performing the same operation but the result is different.

Please give me the detail description about this.

Thank You.