There's nothing wrong here. What do you expect the code to do
my bad, i forgot to explain what im trying. actually i want to add all eleements of a in b in reverse order
Okay. Then this code does that. The output is correct. The elements of a[] are in reverse order in b[]
they are not?
They are. You aren't "adding" anything but storing the values of the array a, into b in reverse order.
And what do you mean add all elements of a in b? if you add all elements of a, it becomes just one element. And addition is commutative, order doesn't matter.
Обсуждают сегодня