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
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