Question: Write a program in C++ that includes a function that accepts a string and a character as inputs and returns the number of times the
Write a program in C++ that includes a function that accepts a string and a character as inputs and returns the number of times the character given as the second argument appears in the string.
Example:
"Enter a string of characters", "Enter a character"
and printf the number of times the character appears in the string of characters.
Use:
int main()
{
char str[100]
}
int numTimesAppears(char *mystring, char ch)
{
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
