HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C program to Check Whether an Alphabet is Vowel or Consonant Using Switch Case ?


Q:- Write a C program to Check Whether an Alphabet is Vowel or Consonant Using
       Switch Case ?
      Input
        #include<stdio.h>
        #include<conio.h>
         main()
   {
char ch;
clrscr();
printf(“Enter a Character =”);
scanf(“%c”,&ch);
switch(ch)
{
case ‘a’:
case ‘e’:
case ‘i’:
case ‘o’:
case ‘u’:
case ‘A’:
case ‘E’:
case ‘I’:
case ‘O’:
case ‘U’:
printf(“%c is Vowel.”,ch);
break;
default : printf(“%c is consonant.”,ch);
}
getch()
}


Output

Enter a Character = E
E is Vowel.

Comments