Check whether the input is in uppercase or in lowercase or a digit
The following program checks the input whether it is in upper case or in lower case or a digit. The program is implemented using java.
Code :
import java.util.Scanner;
class checking
{
public static void main(String []args)
{
String str;
Scanner s=new Scanner(System.in);
str=s.next();
char c=str.charAt(0);
if(c>=65 && c<=90)
System.out.println("Uppercase");
else if(c>65)
System.out.println("Lowercase");
else
System.out.println("Digit");
}
}

Comments
Post a Comment