This is a piece of code to add the same number multiple times to an empty array but when I am printing the now non empty array, I am getting some other values: