Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active October 21, 2019 18:58
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/22635974bdc8dc5b61f2bbc1d5fa488f to your computer and use it in GitHub Desktop.
Save parzibyte/22635974bdc8dc5b61f2bbc1d5fa488f to your computer and use it in GitHub Desktop.
int contarConsonantes(char cadena[]) {
int consonantes = 0;// Almacenar la cantidad de consonantes
int i = 0;// El índice para recorrer la cadena
while (cadena[i]) {
// Si es del alfabeto pero no es vocal
if (isalpha(cadena[i]) && !esVocal(cadena[i])) {
consonantes++;
}
i++;
}
return consonantes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment