Write a program in java to check whether the entered character is upper case alphabet, lower case alphabet, digit or special character
import java.util.Scanner;
class charcheck
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
System.out.println("Enter the Character:");
char ch= sc.next().charAt(0);
if(ch>=65&&ch<=90)
System.out.println("Character is Uppercase Alphabet.");
else if(ch>=97&&ch<=122)
System.out.println("Character is lower Case Alphabet");
else if(ch>=48&&ch<=57)
System.out.println("Caracter is Digit");
else
System.out.println("Character is Special Character.");
}
}
MORE PROGRAMS
NEED HELP!!! CONTACT ME .
class charcheck
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
System.out.println("Enter the Character:");
char ch= sc.next().charAt(0);
if(ch>=65&&ch<=90)
System.out.println("Character is Uppercase Alphabet.");
else if(ch>=97&&ch<=122)
System.out.println("Character is lower Case Alphabet");
else if(ch>=48&&ch<=57)
System.out.println("Caracter is Digit");
else
System.out.println("Character is Special Character.");
}
}
MORE PROGRAMS
NEED HELP!!! CONTACT ME .
Post a Comment