>i can sort 2 strings but can't sort 3 strings.
If you can sort two strings, you know how to sort three. This is especially easy because there's a smallest, a largest, and only one inbetween. So all you need to do is find the smallest and largest before you can determine the order.
Bump a 3 year old thread and put code on it that wont work unless the compiler was made befor 1998? The code you posted wont even work for all casses. What if the order is string 3, string 2 and string 1? No where do you print that combination.