Hello Friends! Welcome to programming shortcut
Today will discuss:
--> Program to find whether the alphabet is a vowel or consonant in c++ or
--> c++ program to check vowel or consonant using a switch or
--> program to check an alphabet is a vowel or consonant in c++
Today will discuss:
--> Program to find whether the alphabet is a vowel or consonant in c++ or
--> c++ program to check vowel or consonant using a switch or
--> program to check an alphabet is a vowel or consonant in c++
#include
using namespace std;
int main(){
char ch;
cout cin>>ch;
switch(ch)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
cout break;
default:
cout }
return 0;
}
using namespace std;
int main(){
char ch;
cout cin>>ch;
switch(ch)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
cout break;
default:
cout }
return 0;
}
Output:
First, run:
Enter the alphabet :
a
The alphabet is a vowel
Second-time run:
Enter the alphabet :
d
The alphabet is a consonant
First, run:
Enter the alphabet :
a
The alphabet is a vowel
Second-time run:
Enter the alphabet :
d
The alphabet is a consonant
Explanation: In this programming, we use the Switch case to check an alphabet is a vowel or consonant
Hello, Friend We first write the program and compile them and run the program to check compiler error or run time error.
Please share the site and comment on your ideas and your suggestions. All suggestion was all welcome.
If any question or doubt in the programming please mention the comment.
Thank yours very much.