printing reverse of a string