3/07/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

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:

  1. Very informative article.Thank you author for posting this kind of article .

    http://www.wikitechy.com/view-article/vowel-checking-program-in-c-with-example-and-explanation


    Both are really good,
    Cheers,
    Venkat

    ReplyDelete
    Replies
    1. Thanks You Visitor you like A article

      Delete