//It should count how many characters are letters in the English alphabet, and is
displaying the correct letters, but is not counting good.
displaying the correct letters, but is not counting good.
Code:
void FunctionCountLetters(char s[]) { int len; int i; len=strlen(s); cout<<"\n The lenght of the string is= "<<len<<endl; int counter=0; for(i=0; i<len; i++) { if((s[i]>='a'&& s[i]<='z')||(s[i]>='A'&& s[i]<='Z')) cout<<"The letters in the English alphabet are: "<<s[i]<<endl; counter++; }//end of for loop. cout<<"The number of letters in the English alphabet are: "<<counter; }//end of function count letters.
Comment