#include #include #include int main(int argc, char *argv[]) { int loop = 0; //Va
ID: 3656208 • Letter: #
Question
#include
#include
#include
int main(int argc, char *argv[])
{ int loop = 0; //Variable used for counting in the loop.
int keystrokes = 0; //Counts number of keystrokes.
int letters = 0; //Counts number of total letters.
int vowels = 0;//Counts number of vowels.
char sentence[9999]; //Defines the character array that will hold the input sentence. and fills it with the user's input.
printf("Sentence Analyzer. ");
printf("Input your sentence(s), then hit enter. ");
scanf(" %c", &sentence);
for(loop = 0; sentence[loop] != ' '; loop++) {
if (sentence[loop] = 'a'||'e'||'i'||'u')
{
++keystrokes;
++letters;
++vowels;
}
else
{
if (isalpha(sentence[loop]) == 1)
{
++keystrokes; ++letters;
}
else {
++keystrokes; } } }
printf("keystrokes%c ", keystrokes);
printf("Alpha Characters %c ", letters);
printf("Vowels %c", vowels);
return 0;
}
Explanation / Answer
/*you may also download the code from.....http://www.2shared.com/file/9NEOieJb/VOWEL.html*/ #include#includeint main(int argc, char *argv[]) { int loop = 0; int keystrokes=0; int letters=0; int vowels=0; char sentence[99]; clrscr(); printf(" Sentence Analyzer."); printf(" Input your sentence(s), then hit enter. "); gets(sentence); while(sentence[loop]!='') { keystrokes++; if((sentence[loop]>='a' && sentence[loop]='A' && sentence[loop]Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.