Pergunta de entrevista da empresa Cognizant

Write a code to swap the numbers in an array.