This is not a graded question so please don't disregard it as if it is. Thank you in advance professor! strlen(str2)/2)If such substring exists, the function retums the index of its initial character...

This is not a graded question so please don't disregard it as if it is. Thank you in advance professor!Write a C function with the following prototype:<br>int strFindSimilar (char strl[), char str2[]);<br>Given two strings strl and str2 the function searches in str1 for the first occurrence of a substring similarstrlen(str2)/2) If such substring exists, the function retums the index of its initial character in str1. Otherwise the function returns -1. Example of execution: strFindSimilar("FifthofNovember", "September") returns 6 because the substring "£November", that starts at character 6, has 5 characters in common with the string "September": strFindSimilar ("Seventh", "September") returns -1 "/>
Extracted text: Write a C function with the following prototype: int strFindSimilar (char strl[), char str2[]); Given two strings strl and str2 the function searches in str1 for the first occurrence of a substring similar" to str2. Two strings are considered "similar" if: they have the same length the number of corresponding characters of the two strings that are equal to each other is more than half the length of str2 (that is, >strlen(str2)/2) If such substring exists, the function retums the index of its initial character in str1. Otherwise the function returns -1. Example of execution: strFindSimilar("FifthofNovember", "September") returns 6 because the substring "£November", that starts at character 6, has 5 characters in common with the string "September": strFindSimilar ("Seventh", "September") returns -1

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here