(Longest common prefix) Rewrite the prefix function in Programming Exercise to find the longest common prefix of two strings using C-strings with the following header:
void prefix(const char s1[], const char s2[],char commonPrefix[])
Write a test program that prompts the user to enter two C-strings and displays their common prefix. The sample run is the same as in Programming Exercise.
(Longest common prefix) Write the prefix function using the following function header to return the longest common prefix between two strings:
string prefix (const string& s1, const string& s2)
Write a test program that prompts the user to enter two strings and displays their longest common prefix. Sample runs of the program are the same as in Programming Exercise.
Exercise (Longest common prefix) Write a program that prompts the user to enter two strings
and displays the largest common prefix of the two strings. Here are sample runs:


We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.