Blogger Widgets


C# Program to check character is capital, small, digit or special symbol
Program to take one character from user and determine whether the entered character is a capital letter, a small case letter, a digit or a special symbol

Program Statement: 
Write a program which take one character from user and determine whether the character entered is a capital letter, a small case letter, a digit or a special symbol. 

Solution:
static void Main(string[] args)
{
char ch;
int a;
Console.WriteLine("Enter any Character:");
ch = Convert.ToChar(Console.ReadLine());
a= (int)ch;
if (a >= 65 && a <= 90)
Console.WriteLine("Entered Character is in Capital Letter");
else if(a>=97 && a<=122)
Console.WriteLine("Entered Character is in Low Letter");
else if(a>=48 && a<=57)
Console.WriteLine("Entered Character is a digit");
else
Console.WriteLine("Entered Character is a Special Symbol");
Console.ReadLine();
}



C# Program to check character is capital, small, digit or special symbol
29 Nov 2013

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top