Pregunta de entrevista de Cognizant

Write a code to swap the numbers in an array.