Find ASCII Value of Character in JAVA - 👑 सार्थक मुंड S3 🤴🏻

Find ASCII Value of Character in JAVA

Write a program (WAP) in JAVA to read two numbers from keyboard(User Input) to find ASCII value of a character.

import java.util.Scanner;
 
class GetASCII
{
    public static void main(String args[])
    {
        char c;
        short AsciiValue;
        
        Scanner SC=new Scanner(System.in);
        
        System.out.print("Enter a character: ");
        c=SC.next().charAt(0);
        
        AsciiValue= (short)c;
        System.out.println("ASCII value of " + c + " is : " + AsciiValue);
        
    }
}




Also Read :-

  1. Programs of C

  2. Programs  of C++

  3. Programs of Java

  4. Programs of Python

  5. Codes with HTML, CSS, JS

  6. More Questions & Answers

 

Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads