anonymous
  • anonymous
Write a program that inputs a line of text and a substring to search for.Then it should display the position of first and last occurence of the word?
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
e.mccormick
  • e.mccormick
OK. What language, how far did you get, and where are you having trouble?
e.mccormick
  • e.mccormick
What you need to use is not that hard to describe. Most programming languages have a string search that takes a string, a sub-string, and a starting point as arguments. They return the numerical position in the string of the next instance of the sub-string after the starting point. That, a little bit of input and output, a loop, and a conditional statement should cover it. Well, you might need the length of the string function and some little things like that, but still, not much else.
anonymous
  • anonymous
Sorry its C++

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

e.mccormick
  • e.mccormick
http://www.cplusplus.com/reference/string/string/find/

Looking for something else?

Not the answer you are looking for? Search for more explanations.