Cognizant Interview Question

1.Reverse a string 2.Write a swap function.