Monday, 7 March 2016

C++ Program For Check Character Is Vowel Or Not Using If Else

Problem :- Write A C++ Program For Check Character Is Vowel Or Not Using If Else Statement .

Logic :- As we know that there are 26 Character in 
English Language and only 5 Vowel Or 21 Constant ,We also know that our keyboard support only two types of English Character Capital Of Small So only we need to compare with only 5 Character .
5 Vowels are A E I O U and rest are Constant . So just we need to compare with Capital and Small Both .
If you got the Logic then try to solve the given Problem  

Try Yourself C Program To Check Number Is Positive Or Negative

Solution :-

#include<bits/stdc++.h>
using namespace std;
int main()
{
  //Ghanendra Yadav
    char ch;
    
cout << "Enter an Alphabet :\n";
    cin >> ch;
    
    if(ch=='a'||ch=='A'||ch=='e'||ch=='E'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U')
  {
        cout << ch << " Is A Vowel .\n";
    }
    else
  {
        cout << ch << " Is Not A Vowel.\n";
    }
   
    return 0;
}

Output:-

C++ Program For Check Character Is Vowel Or Not Using If Else

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

2 comments: