Hello guys
Our Dr in college asked me to do this exercise and I'm guessing he doesn't want Arrays in it , because we didn't study Arrays yet.
And I asked him if he wants me to put single characters only and count vowels or write a whole line , and he said we have to type a line not single characters
this is the question :
Write a program to count the vowels and letters in free text given as standard input. Read text a character at a time until you encounter end-of-data.
Then print out the number of occurrences of each of the vowels a, e, i, o and u in the text, the total number of letters, and each of the vowels as an integer percentage of the letter total.
Suggested output format is:
Numbers of characters:
a 3 ; e 2 ; i 0 ; o 1 ; u 0 ; rest 17
Percentages of total:
a 13%; e 8%; i 0%; o 4%; u 0%; rest 73%
Read characters to end of data using a construct such as
char ch;
while(
( ch = getchar() ) >= 0
) {
/* ch is the next character */ ....
}
to read characters one at a time using getchar() until a negative value is returned.
Thanks.