Write a program to check alphabet is Vowel or Consonant in C Language
Q:-Write a program to check alphabet is Vowel or Consonant in C Language?
#include <stdio.h>
int main() {
char alpha;
printf("Enter an alphabet to check it is vowel or consonent or a number:");
alpha=getche();
if(alpha == 'a' || alpha == 'e' || alpha == 'i' || alpha == 'o' || alpha == 'u' || alpha == 'A' || alpha == 'E' || alpha == 'I' || alpha == 'O' || alpha == 'U')
{
printf("\n%c is Vowel",alpha);
}
else if(alpha == '0' || alpha == '1' || alpha == '2' || alpha == '3' || alpha == '4' || alpha == '5' || alpha = = '6' || alpha == '7' || alpha == '8' || alpha == '9')
{
printf("\n%c is number",alpha);
}
else
{
printf("\n%c is Consonant",alpha);
}
return 0;
}