Professional Documents
Culture Documents
Vowel
Vowel
#include <stdio.h>
int main()
{
char ch;
printf("Enter any alphabet: ");
scanf("%c", &ch);
if(ch=>'a' && ch=<'z') || (ch=>'A' && ch=<'Z')
{
printf("invalid input");
end(0);
}
switch(ch)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
printf("Vowel");
break;
default:
printf("Consonant");
}
return 0;
}
-----ALGO
Declare ch
Input an alphabet from user
if statement to check if an alphabet
Switch the value of ch.
Proagram will check the vowel or consonent
output