#include<stdio. h>
int count (char letter, const char *my_string);
void main()
{
int total_l;
char my_string[] = “walla la oh la la la la la long”;
char letter = ‘l’;
total_l = count(letter, my_string);
printf(“There are %d character l in the string\n”, total_l);
}
*required to write a recursive function to count the number of times character ‘l’
appears in a string “walla la oh la la la la la long”
* prints that number on your screen. Your function should be able to;
(a) Count character ‘l’.
(b) Test whether the character ‘l’ is in the string.
(c) If the string had no character at all, we would know immediately that there
were zero occurrences of the character being counted.
(d) If there is any, your program should track the number of occurrence.
int count (char letter, const char *my_string);
void main()
{
int total_l;
char my_string[] = “walla la oh la la la la la long”;
char letter = ‘l’;
total_l = count(letter, my_string);
printf(“There are %d character l in the string\n”, total_l);
}
*required to write a recursive function to count the number of times character ‘l’
appears in a string “walla la oh la la la la la long”
* prints that number on your screen. Your function should be able to;
(a) Count character ‘l’.
(b) Test whether the character ‘l’ is in the string.
(c) If the string had no character at all, we would know immediately that there
were zero occurrences of the character being counted.
(d) If there is any, your program should track the number of occurrence.
Comment