Question: In c++ please! must use basic c++! WARNING: You MUST use while loop to complete this exercise to receive points! Write a program that accepts
In c++ please! must use basic c++!
WARNING: You MUST use while loop to complete this exercise to receive points!
Write a program that accepts in input 2 strings of equal (but variable) length. Iterate through the strings as long as the same letter appears at the same index. Output the number of matching letters found before the mismatch. For example, if the strings are:
ABHBFAAT ABHBFRAT
The program should output:
5
Because there are 5 matching letters before the first mismatch at index 5. Note that remaining letters are not counted, even if they match.
Any attempt to hard code answers will result in a 0 for the exercise.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
