Login    New User    Forgot Password    Help      

Input as ASCII

Java Tutorials

Example

// input as ascii number
import java.io.*;
class s4
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter any Number ");

int i;
i=(int) br.read();
System.out.println("Ascii code is "+i);
}
}

Output

Java Tutorials