Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 6, 2019 18:17
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/4d4f9a7a19c08f5edd2adaab80a10289 to your computer and use it in GitHub Desktop.
Save parzibyte/4d4f9a7a19c08f5edd2adaab80a10289 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <ctype.h>
/*
Validar si es letra en C++
https://parzibyte.me/blog
*/
int main() {
char letra;
std::cout << "Escribe un carácter:\n";
std::cin >> letra;
if (isalpha(letra)) {
std::cout << "Es una letra";
} else {
std::cout << "NO es una letra";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment