Reverse the given Array without using built in function