At this point, values of variables are:
a = {5,1,15,20,25};
i = uninitialized
j = uninitialized
m = uninitialized
Now,
i = ++a[1];
Gets the value of a[i]
which is 1, increments it and it becomes 2, and then, it is stored in i
.
At this point, values of variables are:
a = {5,2,15,20,25};
i = 2
j = uninitialized
m = uninitialized
Next,
j = a[1]++;
Gets the value in a[1]
which is 2 (since it was incremented in the previous statement), stores this value in j
and then, increments the value stored in a[1]
.
At this point, values of variables are:
a = {5,3,15,20,25};
i = 2
j = 2
m = uninitialized
Then,
m = a[i++];
Gets the value in a[i]
(a[2]
since i
is currently 2) which is 15 and this value is stored in m
. Then, i
is incremented.
At this point, values of variables are:
a = {5,3,15,20,25};
i = 3
j = 2
m = 15