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
Post a Comment