Created
February 18, 2016 11:49
-
-
Save jmramirezpro/74f265f5196d47edd455 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
/* | |
* CaracterVocal.c | |
* Escribe un programa que nos solicite una letra (mayúscula o minúscula) | |
y que muestre por salida estándar si es una vocal o una consonante. | |
* Creado el 16 de feb. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> | |
int main(void) | |
{ | |
char ch; | |
int comprobar; | |
printf("Introduce un catacter: "); | |
comprobar = scanf("%c",&ch); | |
if (comprobar < 1){ | |
/* Error en la introdducción del caracter */ | |
printf("Error en la introducción del caracter\n"); | |
}else if (!isalpha(ch)){ | |
printf("El caracter no es una letra\n"); | |
}else if((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') || (ch == 'u')){ | |
printf("El caracter %c es una VOCAL \n", ch); | |
}else{ | |
printf("El caracter %c es una CONSONANTE \n", ch); | |
} | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment