Question: Word Search (wordSearch.c) Write a program that uses the function specified below to search for a given phrase inside a given string. You may assume

Word Search (wordSearch.c) Write a program that uses the function specified below to search for a given phrase inside a given string. You may assume that the two strings will always be 100 characters or less.

Implement this function: int wordSearch(char *sentence, char *phrase);

The function takes a sentence and a phrase to search in the sentence. If the sentence contains the phrase, then the function returns 1. The main function will prompt the user to enter a sentence and a phrase to search for. Then it will use the wordSearch function to determine if the phrase was found in the sentence or not.

Sample Output:

Enter a sentence: My dogs name is spot.

Enter a phrase to search in the sentence: spot

The phrase "spot" was found.

Enter a sentence: I have a pet dog

Enter a phrase to search in the sentence: cat

The phrase "cat" was NOT found.

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!