Following are the C++ program to replace a character value from the input string:
Program Explanation:
Program:
#include <iostream>//header file
#include <string>//header file
using namespace std;
int main() //main method
{
//defining variables
string str;//string
int P;//integer
char Ch;//character
cin>>str;//input string value
cin >>P;//input integer value
cin >> Ch;//input character value
str.at(P) = Ch; //uing char-at method that takes position index value and replaced by character
cout << str << endl;//print replaced string value
return 0;
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/24497583