Infosys interview question

create a function for reverse string without any inbuilt function