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()); // Alphabet checking condition if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { Console.WriteLine(ch + "is an Alphabet. "); } else if (ch >= '0' && ch <= '9') { Console.WriteLine(ch + "is a Digit. "); } else { Console.WriteLine(ch + "is a Special character.. "); } Console.ReadLine(); } }
Result:
Enter any character:
$
$is a Special character..
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..
Result:
Enter any character:
$
$is a Special character..
need an explanation for this answer? contact us directly to get an explanation for this answer