Using the computational knowledge in python it is possible to write a code that Write a recursive function called digit_count()
<h3>What is a function in Python?</h3>
In Python, a function is a sequence of commands that performs some task and that has a name. Its main purpose is to help us organize programs into chunks that correspond to how we envision a solution to the problem.
<h3>Writting the code in python:</h3>
<em>def countDigits(n):</em>
<em> if n< 10:</em>
<em> return 1</em>
<em> else:</em>
<em> return 1 + countDigits(n / 10)</em>
See more about python at brainly.com/question/13437928
#SPJ1
Answer:
#include <iostream>
using namespace std;
int main()
{
string str;
cout<<"Enter the string: ";
cin>>str;
for(int i=0;str[i]!='\0';i++){
if(str[i]=='e'){
str[i]='x';
}
}
cout<<"the string is: "<<str<<endl;
return 0;
}
Explanation:
First, include the library iostream for using the input/output instructions.
Create the main function and declare the variables.
Then, use the cout instruction and print the message on the screen.
cin store the string enter by the user into a variable.
After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.
This process continues until the string not empty.
Finally, print the updated string.
Try getting to know her or ask her about stuff she enjoys doing or hobbies she likes