Program Explanation:
Program:
#include <iostream>//header file
#include <string>//header file
using namespace std;
int main() //defining main method
{
string workStr, strSelection;//defining string variable
int idxBegin,choiceLen,i=0;//defining integer variable
getline(cin, workStr);//using getline method to input string value
cin >> idxBegin>> choiceLen;//input integer value
strSelection = "";//assign empty space value in string variable
while(i<choiceLen)//defining loop that checks integer value
{
strSelection += workStr[idxBegin+i];//holding value into string variable
i++;//incrementing loop value
}
cout << strSelection << endl;//print string value
return 0;
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/14391069