. What is the output of the following program fragment? string s1 = \"Ball Park\
ID: 1925533 • Letter: #
Question
. What is the output of the following program fragment?string s1 = "Ball Park";
string s2 = "Going to";
string s3 = "the";
string str;
cout << s2 << " " << s3 << " " << s1 << endl;
cout << s1.length() << endl;
cout << s1.find('P') << endl;
cout << s1.substr(0, 4) << endl;
str = "abcdefghijk";
cout << str << endl;
cout << str.length() << endl;
str[0] = 'A';
str[3] = 'D';
cout << str << endl;
Explanation / Answer
Going to the Ball Park 9 5 Ball abcdefghijk 11 AbcDefghijk
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.