Tech Study

C# Program to Check alphabet is vowel or not

Introduction

Write C# Program to Check whether an alphabet is a vowel or not. I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..

using System;
 
public class exercise17
{
    static void Main(string[] args)
    {
        char ch;      
 
        Console.Write("Input an Alphabet (A-Z or a-z) : ");
        ch = Convert.ToChar(Console.ReadLine().ToLower());
        int i = ch;
        if (i >= 48 && i <= 57)
        {
            Console.Write("You entered a number, Please enter an alpahbet.");
        }
        else
        {
            switch (ch)
            {
                case 'a':
                    Console.WriteLine("The Alphabet is vowel");
                    break;
                case 'i':
                    Console.WriteLine("The Alphabet is vowel");
                    break;
                case 'o':
                    Console.WriteLine("The Alphabet is vowel");
                    break;
                case 'u':
                    Console.WriteLine("The Alphabet is vowel");
                    break;
                case 'e':
                    Console.WriteLine("The Alphabet is vowel");
                    break;
                default:
                    Console.WriteLine("The Alphabet is not a vowel");
                    break;
            }
        }
        Console.ReadLine();
    }
}

Result

Write C# Program to Check whether an alphabet is a vowel or not
Write C# Program to Check whether an alphabet is a vowel or not

 

Here are some more example of c# program for your practice:

C# Program to check entered character vowel or consonant

C# Program to check uppercase or lowercase alphabets

TaggedWrite C# Program to Check whether an alphabet is a vowel or not

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more