Computer Science, asked by BrainlyPromoter, 1 year ago

Write a Java Program to check a alphabet is uppercase or lowercase.

Answers

Answered by siddhartharao77
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!
Attachments:

BrainlyPromoter: thanks
BrainlyPromoter: I corrected the asci number and its done
siddhartharao77: I think you made a mistake. Rectify it bro
siddhartharao77: Its working fine for me.
BrainlyPromoter: did
BrainlyPromoter: yeah now it's working
siddhartharao77: You are compiling in which editor?
BrainlyPromoter: BlueJ
siddhartharao77: Ohkkk
siddhartharao77: Did u got the output?
Answered by SnowyPríncess
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