INSERT CHAR BETWEEN DUPLICATE CHAR

Why am I getting segmentation fault?
Also Is this logic correct ?

hello @ there was some small mistakes which i have corrected them


i have commented the mistakes go through the code and try to understand them .
Happy Learning !!