Introduction
Write C# Program to check entered character vowel or consonant. 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 charpexercise { static void Main(string[] args) { char ch; Console.WriteLine("Enter any character: "); ch = Convert.ToChar(Console.ReadLine()); // Condition for vowel checking if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') { Console.WriteLine(ch + " is Vowel."); } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { Console.WriteLine(ch + " is Consonant."); } Console.ReadLine(); } }