C Program to Check if the Given Character is Vowel or Consonant

Write C Program to Check if the Given Character is Vowel or Consonant

//WAP to check whether the given character is vowel or consonant

#include<stdio.h>

int main()
{
	char c;

	printf("Enter the character :--> ");
	scanf("%c", &c);

	if(c == 'a'|| c == 'e' || c == 'i' || c == 'o' || c == 'u')
	{
		printf("The given character is vowel");
	}
	else
	{
		printf("The given character is consonant");
	}

	return 0;

}

Output:

Run 1:
Enter the character :--> p
The given character is consonant

Run 2:
Enter the character :--> e
The given character is vowel

≪ Previous | Next ≫