Tuesday, 13 December 2016

Java Program to Check if Given Alphabets are Uppercase or Lowercase or Digits

Problem:- Java Program to Check if given Alphabets are Uppercase or Lowercase or Digits or Java Program to test if a character is uppercase/lowercase/number or Java Program To Check Character Is Uppercase / Lowercase / Digit / Special Symbol or Determine character is a capital, small case, digit or special symbol or Java code to check number of uppercase letters, lowercase letters.

Explanation:- As we know that Uppercase(A, B, C........Z) or Lowercase ( a,b,c.....z ) or a Digit ( 1,2,3,.......9 ), or a Special Symbol ( #,@,<,> ). Now to solve this problem we will use ASCII Value if you have any problem with ASCII Value you can check Java Program for Print ASCII Value Of Any Character. if the character is between 65 to 90 then You Entered UPPERCASE if it is 97 to 122 then you entered LOWER CASE if it is between 48 to 57 then it is a DIGIT And for rest print SPECIAL SYMBOLS.


See Also:- C++ Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol




Java Program To Check Character Is Uppercase / Lowercase / Digit / Special Symbol


/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com/
*/
import java.io.*;
public class keycheck 
{
    public static void main(String args[]) throws IOException
    {
        char key;
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Press any Key:");
        key = (char) bf.read();

        if(key >= 97 && key <= 123)
        {
            System.out.println(" You Press Lower Case"); //for lower case letter
        }

        else if(key >= 65 && key <= 96) //for upper case letter
        {
            System.out.println(" You Press Upper Case");
        }
        else if(key >= 48 && key <= 57) //for digit
        {
            System.out.println(" You Press Digit");
        }
  else 
        {
            System.out.println(" You Press Special Symbol");
        }
    }
}

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment