To check whether given char is vowel or not.

Write a program to check whether given char is vowel or not.


Source code:

#include<stdio.h>
#include<conio.h>
void main()
{
	char ch;
	clrscr();
	printf("Enter the 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("Vowel");
			break;
		default:
			printf("Invalid choice");
			break;
	}
	getch();
}

Output:

Enter the Character: A
Vowel

Enter the Character: 8
Invalid choice

Leave a Reply

Your email address will not be published. Required fields are marked *