step 1: Read a character
step 2: Cast it into byte and store in b
step 3: Print b
step 4: Exit
Here is the Java Example for the program ASCII Value:
import java.io.*; public class ASCIIValue { public static void main(String args[])throws Exception { InputStreamReader is=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(is); System.out.println("Enter A character and Find Out The Ascii value"); byte b=(byte)System.in.read(); System.out.println(b); } }