1

Here's the code:

public static void main(String args[]) throws IOException {
    int i = System.in.read();

    System.out.println(i);

}

When I input 13 for example it prints out 49..? why is that? And how do I fix that?

user3011240
  • 87
  • 2
  • 8

1 Answers1

2

read reads single character and 1 (character)'s int value is 49

jmj
  • 237,923
  • 42
  • 401
  • 438