Answer :
Method explanation:
- Defining a method "changeCharacter" that takes three parameters that are "character array", and two integer variable "s, k" in its parameters.
- Inside the method, a for loop is declared that takes array value and defines a conditional statement that checks the 3rd character value in the array, is used to the array that holds its key-value.
- Please find the full program in the attachment.
Method description:
void changeCharacter(char* ar, int s, int k)//defining a method changeCharacter that takes three parameters
{
for(int j = 1; ar[j]!='\0'; j++)//defining a for loop for 3rd character value in array
{
if(j%3== 0)//use if block that check 3rd character value in array
{
ar[j-1] = k; //Changing the 3rd character in array
}
}
}
Learn more:
Program: brainly.com/question/12975989
