How to find ascii values in java

//How to find ascii values in java


import java.util.*;
public class M
{
public static void main(String args[])
{
int i;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the value of integer for ascii value: ");
i=sc.nextInt();
char c=(char)i;
System.out.println("ASCII value="+c);
}
}



OUTPUT:
Enter the value of integer for ascii value:
65
ASCII value=A

No comments:

Post a Comment