0
I’m making a program that counts how many vowels there are in the word, I managed to do, now I was trying to make only count a vowel in the word, for example Raphael, the appears 2 times, I want to count only once, could help me ?
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
char nome[100];
char vogais[11]={"AEIOUaeiou"};
int cont=0;
scanf("%s",nome);
for(int i=0;i<strlen(nome);i++)
{
for(int j=0;j<strlen(vogais);j++)
{
if(nome[i]==vogais[j])
{
cont++;
}
}
}
printf("%d\n",cont);
return 0;
}
You want to know if a specific vowel is present or how many specific vowels there are?
– Phelipe
How many vowels are in the word, not counting the vowels repeated in the word
– rafael marques