ICSE Class 10 Computer Applications
Question 60 of 76
Revising Basic Java Concepts — Question 64
Back to all questions 64
Question Question 41
Write a program that inputs a character and prints if the typed character is in uppercase or lowercase.
import java.util.Scanner;
public class KboatCheckCase
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter an alphabet: ");
char ch = in.next().charAt(0);
if(Character.isUpperCase(ch))
System.out.println("Upper Case letter");
else if(Character.isLowerCase(ch))
System.out.println("Lower Case Letter");
else
System.out.println("Character not an alphabet");
}
}Output

