ICSE Class 8 Computer Studies Question 9 of 10

Decision Control Structure — Question 10

Back to all questions
10
Question

Question 10

Create a program to display whether the entered character is in uppercase or lowercase.

public class KboatLetterCheck
{
    public static void checkLetter(char ch) {
        System.out.println("Entered character: " + ch);
        if (ch >= 65 && ch <= 90)
            System.out.println("Uppercase");
        else if (ch >= 97 && ch <= 122)
            System.out.println("Lowercase");
        else
            System.out.println("Not a letter");
    }
}
Output
BlueJ output of KboatLetterCheck.java
Answer