C Program to Check Vowel or Not

« Previous Program Next Program »

Check Vowel or Not in C

To check whether the input alphabet is a vowel or not a vowel in C programming, you have to ask to the user to enter a character and check if character is equal to a, A, e, E, i, I, o, O, u, U. If it is equal to any one of the 10, then it will be vowel, otherwise it will not be a vowel

C Programming Code to Check Vowel or Not

Following C program ask the user to enter an alphabet to check whether it is a vowel or not, then display the result on the screen:

/* C Program - Check Vowel or Not */
void main()
	char ch;
	printf("Enter an alphabet : ");
	if(ch=='a' || ch=='A' || ch=='e' || ch=='E' ||
	ch=='i' || ch=='I' || ch=='o' || ch=='O' ||
	ch=='u' || ch=='U')
		printf("This is a vowel");
		printf("This is not a vowel");

When the above c program is compile and executed, it will produce the following result. Above C Programming Example Output (for vowel):

c program check vowel or not

Above C Programming Example Output (for not vowel):

program to check vowel c

Same Program in Other Programming Language

You may also like same program in other programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test