Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// In C Programming // Connected Problem (Same Problem) 1. Write a function to find the longest common substring of two strings. For example, banana
// In C Programming
// Connected Problem (Same Problem)
1. Write a function to find the longest common substring of two strings. For example, "banana and ana have five common substrings, ana, an, na, n and a, but the longest common substring is "ana". You may not use any [] or functions from string.h. Below is the function declaration: void longestCommonString(char* stri, char* str2, char* result); Your function stores the longest substring in result. You can assume the three char arrays have the same length. In your main function, ask the user to input two strings, and then print out the longest common substring of the two: Enter the first string: hello world Enter the second string: hallo word The longest common substring is llo wor You should change the contents in the six strings (from line1 to line6) so that the printf will work correctly. You may not use any [] in your function and may not have more then ten statements in printSquare. void printSquare (char** lines, int lineNumber) { // Complete Me } = I*** **"; = int main(void) { char line 1 [] char line 2 [] char line 3 [] char line 4 [] char line 5 [] char line 6 [] ** ***"; 11 ** *"; = char* lines [] {line1, line2, line3, line4, line5, line6}; print Square (lines, 6); for (int i 0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started