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();
}
}
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..
Result:
Input an Alphabet (A-Z or a-z) : A
The Alphabet is vowel
need an explanation for this answer? contact us directly to get an explanation for this answer