Write a program to store a character and check it is vowel or consonant

A character is taken from user.. and is checked if it is a vowel or a consonant..


Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. //Coding by: Snehil Khanor
  7. //http://WapCPP.blogspot.com
  8. char x;
  9. cout<<"Please enter a character: ";
  10. cin>>x;
  11. if(x=='a'||x=='A'||x=='e'||x=='E'||x=='i'||x=='I'||x=='o'||x=='O'||x=='u'||x=='U')
  12. cout<<x<<" is a Vowel :)";
  13. else
  14. cout<<x<<" is a consonant :)";
  15. getch();
  16. }

Check out this stream