Pregunta de entrevista de Cognizant

They asked me to write a code to reverse an array and print