Check Whether a Character is Uppercase or Lowercase

Explanation:

  1. Input:
    • The program prompts the user to enter a single character.
  2. Switch Statement:
    • The switch statement checks the value of ch:
      • case 'A' ... 'Z': Matches any uppercase letter (‘A’ to ‘Z’). If the character is uppercase, it prints a corresponding message.
      • case 'a' ... 'z': Matches any lowercase letter (‘a’ to ‘z’). If the character is lowercase, it prints a corresponding message.
      • default: Handles any input that is not an alphabetic letter, such as digits or special characters.
  3. Output:
    • The program prints whether the entered character is an uppercase or lowercase letter, or if it’s not an alphabetic letter.

Example Outputs:

Example 1: Uppercase Letter

Input:

  • Character: G

Output:

Example 2: Lowercase Letter

Input:

  • Character: m

Output:

Example 3: Non-Alphabetic Character

Input:

  • Character: 9

Output: