Saturday 23 June 2012

A program in c++ that determine the character is vowel or consonant



This is the source code to determine "is the entered character is vowel or consonant?" 
#include<iostream.h>
#include<conio.h>
main()
{
      char ch;
      cout<<"Enter an alphabet:";
      cin>>ch;
      if(ch=='a'||ch=='A'||
                          ch=='e'||ch=='E'||
                          ch=='i'||ch=='I'||
                          ch=='o'||ch=='O'||
                          ch=='u'||ch=='U')
                          cout<<"it is a vowel";
                          else
                          cout<<"it is a consonant";
                          getch();
                          }
End

1 comment: