Question: Assume we would like to write a user-defined function that receives a c-string and returns the total counts of the letter 'e' in the string

Assume we would like to write a user-defined function that receives a c-string and returns the total counts of the letter 'e' in the string the function receives. Which one of the following is the correct code for the function? A int countE(char al]) { int c=0; while(a[c]!=10) if(a[c]--'e') C++; return c; ] B. int countE(char a[20]) { int c=0; while(c<20) C++; return c } C. int countE(char a[]) ( int c-0, k=0; while(a[c]!= '\\0'){ } return c; 3 if(a[c]=='e') k++; } D. int countE(char a[]) ( c++; OB OD int c-0, k=0; while(a[c]!= '\\0'){ if(a[c]=='e') k++; OC C++; } return k; W 6 pts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!