Skip to content

Commit

Permalink
CheckAlphabet.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gawadeatul authored Oct 17, 2023
1 parent 4efd7a0 commit 120b5b2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CheckAlphabet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import java.util.Scanner;

public class CheckAlphabet {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a character: ");
char ch = scanner.next().charAt(0);

if (Character.isLetter(ch)) {
System.out.println(ch + " is an alphabet.");
} else {
System.out.println(ch + " is not an alphabet.");
}

scanner.close();
}
}

0 comments on commit 120b5b2

Please sign in to comment.