Question: Please write the following program in C. Function find_substr() takes two string arrays (a, b) as parameters, uses function str_length() to determine the lengths of

Please write the following program in C.
 Please write the following program in C. Function find_substr() takes two

Function find_substr() takes two string arrays (a, b) as parameters, uses function str_length() to determine the lengths of the strings, and then looks for the smaller string anywhere in the bigger string. It returns 1 if the substring is found, or returns -1 if no match is found. Write the two functions. Take two strings as input in the main method and use find_substr() to check if the second string is a substring of the first one. (Restriction: str_length() cannot uses built-in strlen() function) Sample input Sample output madam adam adam is a substring of madam telescope less less is not a substring of telescope 101010 101 101 is a substring of 101010

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!