-
-
Save parzibyte/9cca70a9719ebe4306f044c029e30c75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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