Question #46356

write a program to check whether the entered alphabet is vowel or not using switch case
1

Expert's answer

2014-09-23T04:52:17-0400

Answer on Question #46356, Programming, C#

Problem:

write a program to check whether the entered alphabet is vowel or not using switch case

Solution:


using System;
class Program
{
    public static void Main()
    {
        char letter = Console.ReadKey().KeyChar;
        switch (letter)
        {
            case 'a':
            case 'A':
            case 'e':
            case 'E':
            case 'i':
            case 'I':
            case 'o':
            case 'O':
            case 'u':
            case 'U':
                Console.WriteLine("\nThe letter is vowel!");
                break;
            default:
                Console.WriteLine("\nThe letter isn't vowel!");
                break;
        }
        Console.ReadLine();
    }
}


OUTPUT

The letter is vowel?

http://www.AssignmentExpert.com/

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS