Computer Applications

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

Java

Java Conditional Stmts

31 Likes

Answer

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

Answered By

15 Likes


Related Questions