using System;
class Pro
{
static void Main()
{
char ch;
Console.WriteLine("Enter your input: ");
ch = Convert.ToChar(Console.ReadLine());
if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
Console.WriteLine("You have entered an alphabet");
else if (ch >= '0' && ch <= '9')
Console.WriteLine("You have entered a digit");
else
Console.WriteLine("You have entered a special character");
}
}
class Pro
{
static void Main()
{
char ch;
Console.WriteLine("Enter your input: ");
ch = Convert.ToChar(Console.ReadLine());
if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
Console.WriteLine("You have entered an alphabet");
else if (ch >= '0' && ch <= '9')
Console.WriteLine("You have entered a digit");
else
Console.WriteLine("You have entered a special character");
}
}
No comments:
Post a Comment