Here is a C program for finding a particular alphabet entered by the user is consonant or vowel by using the switch statement. The sample program is given below,
Write a C source code for finding a given character is vowel or consonant..
[Read: Software Company Details] & [Love % Calculator]
VOWEL OR CONSTANT C PROGRAM:
//Header files #include<stdio.h> #include<conio.h> void main() { //Program variables char letter; clrscr();//function to clear previous output printf("Enter the letter : ");//Display function scanf("%c",&letter);//Getting input function // if((letter>'a' && letter<'z')||(letter>'A' && letter<'Z'))//Conditional statement // { switch(letter) //Switch statement { case 'a' : case 'e' : case 'i' : case 'o' : case 'u' : case 'A' : case 'E' : case 'I' : case 'O' : case 'U' :printf("Character is vowel"); break; default: printf("Character is consonant"); break; } // } // else // printf("Character is incorrect"); getch(); }