program to reverse given string