Java Program to find the ASCII value of a character

0
Share

In this program, you’ll learn to Program to find the ASCII value of a character in Java. After write the code, the final output is displayed on the screen.

Example- Find the ASCII value of a character.

import java.util.*;
public class Test{
    public static void main(String arg[]){
        Scanner sc=new Scanner (System.in);
         char ch=sc.next().charAt(0);
         System.out.println("Enter the Character : ");
        int ascii=ch;
        System.out.println("The Ascii value of the"+" " +ch+" "+ "is: "+ascii);
        
    }
}

Output

Enter the Character : K
The Ascii value of the K is: 75
  • What are the List of CSS3 New Features ?
    CSS3 is the latest version of the normal CSS . CSS3 adds several new styling features and improvements to enhance the web presentation capabilities. Text Effect in...
  • CSS Basic Property
    What is CSS ? CSS stands for Cascading Style Sheets. CSS basically used in designing the web tags & pages. CSS is the most popular used...
  • Java Program to swap two number use 3rd variable
    In this program, you’ll learn to Program to swap 2 number with 3rd variable in Java. After write the code, the final output is displayed on...
  • Java program to multiply two floating point number
    In this program, you’ll learn to Program to multiply two floating point number in Java. After write the code, the final output is displayed on the...
  • Java Program to find the ASCII value of a character
    In this program, you’ll learn to Program to find the ASCII value of a character in Java. After write the code, the final output is displayed...
  • Java Program to calculate quotient & reminder
    In this program, you’ll learn to Given Number is even or odd in Java. After write the code, the final output is displayed on the screen....

%d bloggers like this: