What is the output of the following program? (11)
using namespace std;
int main()
{
string str = "Regular exercise can reduce health insurance cost.";
string str1;
string str2 = "low fat diet";
string newStr;
string::size_type index;
index = str.find("can");
str1 = str.substr(0, index - 1);
cout <>
newStr = str1 + " and " + str2;
cout <><><>
index = str.find("health"); newStr = str.substr(index, 17);
index = str.find("cost"); cout <>
str = "$ocial Nedia!!"; cout <><><>
str[0] = 'S'; index = str.find('N'); str[index] = 'M';
return 0;
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here