//Sample Program to check whether a given character is Vowel or not
#include < iostream.h >
#include < conio.h >
	void main()
	{
	char x;
	clrscr();
	cout << "\n Enter a character: ";
	cin>>x;
	switch(x)
	{
	case 'A':
	case 'a': cout << "\n " << x <<" is a vowel " << endl;
	break;
	case 'E':
	case 'e': cout << "\n " << x <<" is a vowel " << endl;
	break;
	case 'I':
	case 'i': cout << "\n " << x <<" is a vowel " << endl;
	break;
	case 'O':
	case 'o': cout << "\n " << x <<" is a vowel " << endl;
	break;
	case 'U':
	case 'u': cout << "\n " << x <<" is a vowel "<< endl;
	break;
	default: cout << "\n " << x <<" is not a vowel " << endl;
	}
	getch();
	}

<< GO BACK

Our aim is to provide information to the knowledge seekers.


comments powered by Disqus


Footer1