GET ASCII VALUE OF ANY NUMBER || JAVA PROGRAM

        
dhiren1_4

       GET ASCII VALUE OF ANY NUMBER 

ASCII VALUE MEANS "American standard code for informantion interchane"

For example:

10 in human understandable language:
ASCII value will be 49:

PROGRAM:

import java.util.*;
class GetASCII
{
    public static void main()
    {
    char a;
    short value;
    Scanner sc=new Scanner(System.in);
    System.out.print("Enter a character : ");
    a=sc.next().charAt(0);
    value=(short)a;
    System.out.print("ASCII value of "+a+ " : "+value);
    }
}


                      OUTPUT

GET ASCII VALUE OF ANY NUMBER || JAVA PROGRAM

Post a Comment

1 Comments