Why do the array values change, and why does this print twice?

Printable View