vowel selector program in C++


vowel selector program in C++


OBJECT

write a c++ program that take character input from user and tells that the character is a vovel or a consonant using switch statement




Algorithm


STEP#1    Start
STEP#2    Declare the variables symb
STEP#3    input character
STEP#4    switch symb
STEP#5    if case ’a’ or case ’e’ or case ’i’ or case ’o’ or case ’u’
STEP#6    display “You have entered a vowel”
STEP#7    if default then display “You have entered a consonent”
STEP#8    end






Code

#include <iostream>
using namespace std;
int main()
{
    char symb;
    cout<<"Enter any character = ";
    cin>>symb;
    switch(symb)
    {
         case'a':
         case'e':
         case'i':
         case'o':
         case'u':
         cout<<"\nYou have entered a vowel\n\n";
         break;
        default:
         cout<<"You have entered a consonent\n\n";
         break;
    }
    return 0;
}




vowel selector program in C++

Popular posts from this blog

Real marksheet using HTML

Salary Calculate Application in C#