Logic:
- Input a character
- Check whether it is a vowel or not for Both lower-case and upper-case are checked.(Vowels are A,E,I,O,U,a,e,I,o,u and other alphabets are consanants)
#include
#include
void main()
{
char ch;
clrscr();
printf("Enter a character\n");
scanf("%c", &ch);
// Checking both lower and upper case characters, || is the OR operator
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 not a vowel.\n", ch);
getch();
}