diff --git a/Basic/Check Whether a Character is Vowel or Consonant/SolutionByPrabsimar.cpp b/Basic/Check Whether a Character is Vowel or Consonant/SolutionByPrabsimar.cpp new file mode 100644 index 000000000..c2cf3f563 --- /dev/null +++ b/Basic/Check Whether a Character is Vowel or Consonant/SolutionByPrabsimar.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +int main() { + char v; + cout<<"Enter the character: "; + cin>>v; + + int check = isalpha(v); + + if (check == 0) + { + cout << "Not an Alphabet"; + } + else + { + if(v == 'a' || v == 'e' || v == 'i' || v == 'o' || v == 'u' || v == 'A' || v == 'E' || v == 'I' || v == 'O' || v == 'U') + { + cout << "It is a Vowel"; + } + else + { + cout << "It is a consonent"; + } + } + return 0; +}