Code:
#include <stdio.h>
#define SIZE 50
void CountVowelLetters(char, int, int, int, int, int);
void CountVowelLetters1(int, int, int, int, int);
int main (void)
{
int vowels;
int va = 0;
int ve = 0;
int vi = 0;
int vo = 0;
int vu = 0;
char c;
char s[SIZE];
int i=0;
puts("Enter a Line of Text:");
while ((c = getchar()) != '\n'){
s[i++] = c;
CountVowelLetters(c, va, ve, vi, vo, vu);
}
puts("The number of Vowels A,E,I,O,U,a,e,i,o,u is:");
return 0;
}
void CountVowelLetters(char c, int va, int ve, int vi, int vo, int vu){
int vowel;
if(c=='a' || c=='A')va++;
if(c=='e' || c=='E')ve++;
if(c=='i' || c=='I')vi++;
if(c=='o' || c=='O')vo++;
if(c=='u' || c=='U')vu++;
vowel = (va + ve + vi + vo + vu);
printf("%d", vowel);
}
Have it all set up, but I don't understand how to do this:
Input:
This is ok
Output:
The number of Vowels A,E,I,O,U,a,e,i,o,u is: 3
Instead i have
Output:
This is ok
0010010010The number of Vowels A,E,I,O,U,a,e,i,o,u is: