data structures using str[jstr[ ]str[itempi++ --printf("\ the reversed string is ")puts(str)getch()return output enter the stringhi there the reversed string isereht ih extracting substring from string to extract substring from given stringwe need the following three parameters the main string the position of the first character of the substring in the given stringand the maximum number of characters/length of the substring for exampleif we have string str["welcome to the world of programming"thenstep [initializeset =mjstep repeat steps to while str[ !null and nstep set substr[jstr[istep set step set step set [end of loopstep set substr[jnull step exit figure algorithm to extract substring from the middle of string substring(str world figure shows an algorithm that extracts substring from the middle of string in this algorithmwe initialize loop counter to mthat isthe position from which the characters have to be copied steps to are repeated until characters have been copied with every character copiedwe decrement the value of the characters of the string are copied into another string called the substr at the enda null character is appended to substr to terminate the string programming example write program to extract substring from the middle of given string #include #include int main(char str[ ]substr[ ]int = = nmclrscr()printf("\ enter the main string ")gets(str)printf("\ enter the position from which to start the substring")scanf("% "& )printf("\ enter the length of the substring")scanf("% "& ) =mwhile(str[ !'\ & >