reverse a string in c without using library function