Program to determine whether given character is vowel or consonant

In english language A,E,I,O,U vowels. Following program takes one character and checks it for vowel condition using || (or) as logical operator.




#include

main()
{

char ch;
clrscr();

pritnf("\nEnter any character:");
fflush(stdin);
scanf("%c",&ch);
if (ch == 'A' || ch = 'a'|| ch = 'E ' || ch == 'e' || ch == T || ch == 'i' ||
ch == 'O' || ch == 'o' || ch == 'U' || ch = 'u')
{
printf("\n The entered character %c is Vowel.\n", ch);
}
else
{
printf("\nThe entered character %c is not Vowel.\n",ch);
}
}

1 comment: