substr[jstr[ ] ++ ++ --substr[ '\ 'printf("\ the substring is ")puts(substr)getch()return output enter the main string hi there enter the position from which to start the substring enter the length of the substring the substring is th step [initializeset ijand kstep repeat steps to while text[ !null step if pos repeat while str[ !null new_str[jstr[kset = + set + [end of inner loopelse new_str[jtext[iset + [end of ifstep set + [end of outer loopstep set new_str[jnull step exit figure algorithm to insert string in given text at the specified position inserting string in the main string the insertion operation inserts string in the main text at the th position the general syntax of this operation is insert(textpositionstringfor exampleinsert("xyzxyz" "aaa""xyzaaaxyzfigure shows an algorithm to insert string in given text at the specified position this algorithm first initializes the indices into the string to zero from steps to the contents of new_str are built if is exactly equal to the position at which the substring has to be insertedthen the inner loop copies the contents of the substring into new_str otherwisethe contents of the text are copied into it programming example write program to insert string in the main text #include #include int main(char text[ ]str[ ]ins_text[ ]int = = = ,posclrscr()printf("\ enter the main text ")gets(text)printf("\ enter the string to be inserted ")gets(str)printf("\ enter the position at which the string has to be inserted")scanf("% "&pos)while(text[ ]'\ '