Ok couple of things....
A string is actually an array. In C all array indexes begin at 0 and go to size-1 ... thus a 10 element array will have elements numbered 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9... go ahead count them, that's 10.
Now, take a look at your loops and swaps...
When the string is length 10 ... where does your loop exit?
When the index i is at 0 which element is the swap accessing with length - i ?
These are called bounds errors and they can lead you to crashing your program... or at least getting some truly magical results.
The fix is very simple... but in the interests of your education, we'll let you figure it out by yourself.