Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started