Question: Write a C function which receives 2 strings L1 and S1, the function should count how many times the string S1 was found in L1.

 Write a C function which receives 2 strings L1 and S1,

Write a C function which receives 2 strings L1 and S1, the function should count how many times the string S1 was found in L1. (5 marks) Example: If user enters the following: LI: "xyzabodhiabcefg" S1: "abc" The function should find "abc" repeated twice in Li, hence the function should return 2. In main do the following: (5 marks) 1. Define the 2 strings. 2. Read a complete line from user and place it in Ll. 3. Read a single word from user and place it in Si. 4. Pass the two strings to the function. 5. Print the count

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!