This is not a graded question so please don't disregard it as if it is. Thank you in advance professor!Ps: everything should be coded in C Not C++ strlen(str2)/2)If such substring exists, the...

This is not a graded question so please don't disregard it as if it is. Thank you in advance professor! Ps: everything should be coded in C Not C++Write a C function with the following prototype:<br>int strFindSimilar(char str1[], char str2[]);<br>Given two strings str1 and str2, the function searches in str1 for the first occurrence of a substring<br>strlen(str2)/2) If such substring exists, the function returns the index of its initial character in str1. Otherwise, the function returns -1. Example of execution: strFindSimilar("FifthOfNovember", "September")returns 6 because the substring "fNovember", 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 str1[], char str2[]); Given two strings str1 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 returns the index of its initial character in str1. Otherwise, the function returns -1. Example of execution: strFindSimilar("FifthOfNovember", "September")returns 6 because the substring "fNovember", that starts at character 6, has 5 characters in common with the string "September"; strFindSimilar("Seventh", "September") returns -1.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here