here is a very simple code, in which i am trying to take input from keyboard in a loop. For every input, the loop is automatically running two extra times and taking the values 13 and 10, no matter what i give as input. can you please point out what i am doing wrong.
CODE:
public static void main(String args[]) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); boolean loop_cond=true; int n=1; while(loop_cond==true) { try { System.out.print("input : "); n=br.read(); } catch (IOException e) { e.printStackTrace(); } System.out.print(n+"\n"); } } // end Main OUTPUT :
input : 6 54 input : 13 input : 10 input : 9 57 input : 13 input : 10 input : 1 49 input : 13 input : 10 input :