From 348e6c2c3d79e8c2125df7cc9e3563df50d04ebe Mon Sep 17 00:00:00 2001 From: Prabsimar Singh <31936615+Prabsimar@users.noreply.github.com> Date: Fri, 6 Oct 2023 21:53:22 +0530 Subject: [PATCH] SolutionByPrabsimar.cpp --- .../SolutionByPrabsimar.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Basic/Check Whether a Character is Vowel or Consonant/SolutionByPrabsimar.cpp 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; +}