Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 6, 2019 18:11
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/745aa33e5e09dd809b29f309606d7702 to your computer and use it in GitHub Desktop.
Save parzibyte/745aa33e5e09dd809b29f309606d7702 to your computer and use it in GitHub Desktop.
/*
Validar si carácter es una letra en C
https://parzibyte.me/blog
*/
#include <stdio.h>
#include <ctype.h>
int main(void) {
char letra;
printf("Escribe un carácter:\n");
scanf("%c", &letra);
if (isalpha(letra)) {
printf("Es una letra");
} else {
printf("NO es una letra");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment