im trying to write a program that counts the total vowels in a string and count the number of each individual vowel(like total A's=4 and so on) Im stuck with my fisrt function to count the total vowels im getting a compiler error that says expected primary expression before '}' token.I cant figure out what that means can someone help
Code:
Code:
#include <stdio.h>
int countvowels(char []);
//int displayleachvowels(char[]);
int main ()
{
char sentence[150];
int vowels=0;
printf("Enter a sentence \n");
gets(sentence);
vowels = countvowels(sentence);
printf("Number of vowels: %d\n", sentence);
// total=displayleachvowels(sentence);
// printf("Total A's:,E's,I'sO's,U's, %d\n%d\n%d\n%d\n%d\n", sentence);
return 0;
}
int countvowels(char sentence[])
{
int x=0;
int count=0;
for(x=0;sentence[x]!='\0';x++)
{
if(sentence[x]=='a' || sentence[x]=='e' || sentence[x]=='i' ||
sentence[x]=='o' || sentence[x]=='u' || sentence[x]=='A' ||
sentence[x]=='E' || sentence[x]=='I' || sentence[x]=='O' ||
sentence[x]=='U')
} // error here
count++;
}