Header Ads

  • Breaking News

    Write A Program In C++ to Find Vowel And Consonant

    A vowel is a,e, i,o,u and other all alphabets are called consonant.
    in C++ we write the code in the following format.


    #include<iostream>
    using namespace std;
    int main ()
    {

    char c;
    int islowercasevowel,isuppercasevowel;
    cout<<"enter a alphabet"<<endl;
    cin>>c;

    islowercasevowel = (c=='a'||c=='e'||c=='i'||c=='o'||c=='u');
    isuppercasevowel= (c=='A'||c=='E'||c=='I'||c=='O'||c=='U');
    if
    (islowercasevowel || isuppercasevowel)
    cout<<"is a vowel";
    else
    cout<<"is a consonant";
    return 0;

    }





    Related Example

    Make A Simple Calculator in C++ Using Switch Statement
    Find if the no is prime or not by creating function in C++
    Display Multiplication table up to 10 of the no. entered by the user
    Write a C++ code to reverse digits of any given integer number.

    No comments

    Post Top Ad

    Post Bottom Ad