Write a Java Program to check a alphabet is uppercase or lowercase.
Answers
Answered by
5
import java.util.Scanner;
class Brainly
{
public static void main(String args[])
{
char alpha;
System.out.println("Enter an alphabet");
Scanner Demo = new Scanner(System.in);
alpha = Demo.next().charAt(0);
if(alpha >= 97 && alpha <= 123)
{
System.out.println("Entered letter is a lowercase letter");
}
else if(alpha >= 65 && alpha <= 96)
{
System.out.println("Entered letter is an uppercase");
}
else if(alpha >= 48 && alpha <= 57)
{
System.out.println("Entered alphabet is a number");
}
}
}
Hope this helps!
class Brainly
{
public static void main(String args[])
{
char alpha;
System.out.println("Enter an alphabet");
Scanner Demo = new Scanner(System.in);
alpha = Demo.next().charAt(0);
if(alpha >= 97 && alpha <= 123)
{
System.out.println("Entered letter is a lowercase letter");
}
else if(alpha >= 65 && alpha <= 96)
{
System.out.println("Entered letter is an uppercase");
}
else if(alpha >= 48 && alpha <= 57)
{
System.out.println("Entered alphabet is a number");
}
}
}
Hope this helps!
Attachments:
BrainlyPromoter:
thanks
Answered by
1
;
Java Program to Check if given Alphabets are Uppercase or Lowercase or Digits
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Alphabet_Check.
public static void main(String args[]) throws IOException.
char m;
Similar questions