Hexaware Technologies interview question

Code for reversing an array without using rev function