Write a c program to check whether an alphabet is a vowel or consonant or digit or special character.
#include
int main()
{
char ch;
printf("Enter a Charecter :");
scanf("%c",&ch);
if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch ==
'u' || ch == 'U')
printf("'%c' is a vowel.\n", ch);
else
printf("'%c' is a consonant.\n", ch);
}
else if(ch >= '0' && ch <= '9')
{
printf("'%c' is digit.", ch);
}
else
{
printf("'%c' is special character.", ch);
}
return 0;
}
WorldTimeTech provides Movie News, Troubleshooting, and Programming knowledge. Thank You...
Copyright © 2023 WorldTimeTech.com All Rights Reserved.