Update array.cpp

i-- changed to j--