Question: (c++) Show the output produced when the following code (entire program not shown) is executed. You are encouraged to also try to compile this in
(c++) Show the output produced when the following code (entire program not shown) is executed. You are encouraged to also try to compile this in a program to verify your results.
code:
string name = "Jeffery Tambor"; cout << "NAME = " + name << endl; cout << name.length() << endl; name.erase(8, 6); cout << name << endl; name.append("Dean WD Morgan"); cout << name << endl; name.insert(22, "@TWD"); cout << name << endl; name.replace(23, 3, "The WD"); cout << name << endl; cout << name.find("WD") << endl; cout << name.rfind("WD") << endl; cout << name.rfind("fery") << endl; for (int i = name.length(); i > 20; i--) cout << name[i-1]; cout << endl;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
