any help would be appriciate it. 1 125 pointslGive the implementation of operato
ID: 3796831 • Letter: A
Question
any help would be appriciate it.
Explanation / Answer
#include <iostream>
#include <cstring>
using namespace std;
void count(const char s[],
int counts[],
int size);
int main()
{ int counts;
//Enter a string of characters
cout << "Enter a string: ";
// i.e. any phrase
char s[80];
cin.getline(s,80);
cout << "The number of letters in " << s << " is " << count(s,counts) << endl;
return 0;
}
void count(const char s[],
int counts[26], int size);
{ for (int i = 0; i < strlen(s); i++) { if (isalpha(s[i])) count++; }
for (int i = 0; i < 26; i++)
if ((i + 1) % 10 == 0)
cout << counts[i] << " " << static_cast<char>(i + 'a') << endl; else cout << counts[i] << " " << static_cast<char>(i + 'a') << " ";
return count;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.