Write a program that reads in a line of text and then


Question: Write a program that reads in a line of text and then outputs that line of text with the first occurrence of "hate" changed to "love". For example, a possible sample dialog might be the following: Enter a line of text. I hate you. I have rephrased that line to read: I love you. You can assume that the word "hate" occurs in the input. If the word "hate" occurs more than once in the line, your program should replace only the first occurrence of "hate".

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that reads in a line of text and then
Reference No:- TGS02404297

Now Priced at $15 (50% Discount)

Recommended (95%)

Rated (4.7/5)