Move All x at End

There is a segmentation fault in my code. Can you please tell me where is the error in my ocde?

CODE: https://ide.codingblocks.com/s/585514

the approach you have used is wrong. It not doing valid recursive calls, take reference from this

I want to solve it like bubble sort. Like in bubble sort what we actually do if we find a[i]>a[i+1] then we swap and this what I am doing if A[i]==‘x’ then swap and then make a recursive call by increasing i by 1 until the x will be shifted to last like in bubble sort highest element shifted to last and when i==n it will make recursive call by making i=0 and n-1.

what we have to do is, whenever we find any x char , we move it till the end of the array, and shift all the rest elements leftward by 1 increment.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.