Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 13, 2021 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/9cca70a9719ebe4306f044c029e30c75 to your computer and use it in GitHub Desktop.
Save parzibyte/9cca70a9719ebe4306f044c029e30c75 to your computer and use it in GitHub Desktop.
int esVocal(char letra)
{
// Convertir para simplificar comparaciones
char letraMinuscula = tolower(letra);
char vocales[] = "aeiou";
// Recorrer las vocales y comparar si la letra es una de ellas
int i;
for (i = 0; vocales[i]; i++)
{
if (letraMinuscula == vocales[i])
{
return 1;
}
}
// Si terminamos de recorrer y no regresamos true dentro del for, entonces no es vocal
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment