Please follow the following method and function and main to

Please follow the following method and function and main to solve this problem and output has to be same please.

Question - Write a recursive function to check if a given string is a palindrome. First complete given function prototype: bool isPal(const string &str;, int start, int end); Then use the provided driver program to test your code. 2- Write a recursive function that returns the frequency of occurrence ofa particular digit \'d\' in an integer n, First complete given function prototype: int frequencyCount(int number, int digits); Then use the provided driver program to test your code. Submit a single cpp file le

Solution

int frequencyCount(int number,int digits)
{
if(number>0)
{
if(digits==number%10)
{
return frequencyCount(number/10,digits)+1;
}
else
return frequencyCount(number/10,digits);
}
else
return 0;
}

bool isPal(const string &str,int start,int end)
{
if(str[start]==str[end])
{
const string &str1=str;
if(isPal(str,++start,--end))
return true;
}
else
return false;
}

Please follow the following method and function and main to solve this problem and output has to be same please. Question - Write a recursive function to check

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site