//Check case of letter
import java.util.Scanner;
class Letter {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter an alphabet(letter):");
char x=sc.next().charAt(0);
if(x>='A' && x<='Z')
System.out.println("Uppercase Letter");
else if(x>='a' && x<='z')
System.out.println("Lowercase Letter");
else
System.out.println("It's not a letter.");
}
}
import java.util.Scanner;
class Letter {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter an alphabet(letter):");
char x=sc.next().charAt(0);
if(x>='A' && x<='Z')
System.out.println("Uppercase Letter");
else if(x>='a' && x<='z')
System.out.println("Lowercase Letter");
else
System.out.println("It's not a letter.");
}
}
No comments:
Post a Comment