C# Program to Check Whether a Character is a Vowel or Consonant

In this C# program, we will take the input from the user and Check Whether a Character is a Vowel or Consonant.

C# Program to Check Whether a Character is a Vowel or Consonant Code:

private static void Main(string[] args)
        {
            char[] vowels = { 'a', 'e', 'i', 'o', 'u' };
            Console.Write("Enter a character : ");
            char input = char.Parse(Console.ReadLine().ToLower());
            if (Array.IndexOf(vowels, input) > -1)
            {
                Console.Write("Entered character {0} is a Vowel",input);
            }
            else
            {
                Console.Write("Entered character {0} is not a Vowel", input);
            }

            Console.ReadLine();
        }

C# Program to Check Whether a Character is a Vowel or Consonant Output:

CSharp-Program-to-Check-Whether-a-Character-is-a-Vowel-or-Consonant

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
2 + 8 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2022 CodingFusion
75 Important SQL Server queries you should know