java program to add two numbers using bufferedreader

Solutions on MaxInterview for java program to add two numbers using bufferedreader by the best coders in the world

showing results for - "java program to add two numbers using bufferedreader"
Daniele
26 Oct 2016
1// Java program to add two numbers using bufferedreader
2import java.io.BufferedReader;
3import java.io.IOException;
4import java.io.InputStreamReader;
5public class AddTwoBufferedReader 
6{
7   public static void main(String[] args) throws NumberFormatException, IOException 
8   {
9      int number1, number2, add;
10      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
11      System.out.println("Please enter two numbers to add: ");
12      number1 = Integer.parseInt(br.readLine());
13      number2 = Integer.parseInt(br.readLine());
14      add = number1 + number2;
15      System.out.println("Add two numbers using bufferedreader: " + add);
16   }
17}