Write a C Program to check whether character is vowel or not using switch statement. Here’s simple Program to check whether character is vowel or not using switch statement in C Programming Language.
Below is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C Program to check whether character is vowel or not using switch statement */
#include<stdio.h>
int main()
{
char ch;
printf("Enter a character to check :: ");
scanf("%c",&ch);
switch(ch)
{
case 'a':
printf("\nThe entered character %c is a vowel",ch);
break;
case 'e':
printf("\nThe entered character %c is a vowel",ch);
break;
case 'i':
printf("\nThe entered character %c is a vowel",ch);
break;
case 'o':
printf("\nThe entered character %c is a vowel",ch);
break;
case 'u':
printf("\nThe entered character %c is a vowel",ch);
break;
default:
printf("\nThe entered character %c is a consonant",ch);
}
return 0;
}
OUTPUT : :
/* C Program to check whether character is vowel or not using switch statement */
---------------------------------------------------
Enter a character to check :: s
The entered character s is a consonant
---------------------------------------------------
Enter a character to check :: i
The entered character i is a vowel
---------------------------------------------------
Enter a character to check :: a
The entered character a is a vowel
Above is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System.The Output of the program is shown above .
Below is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
OUTPUT : :
Above is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer