Check Either The Input Character Is Digit Or Character (Upper Case or Lower Case)
using System;
class CheckInputCharacter
{
public static void Main()
{
Console.Write("Enter any character:- ");
char ch = (char)Console.Read();
if(char.IsDigit(ch))
{
Console.WriteLine("You entered digit");
}
else
{
if(char.IsUpper(ch))
{
Console.WriteLine("You entered upper character");
}
else
{
Console.WriteLine("You entered lower character");
}
}
}
}
OUTPUT
Check Either The Input Character Is Digit Or Character (Upper Case or Lower Case)
Reviewed by Baljeet Singh
on
12:14
Rating:
No comments: