Sum

April 11, 2016, by Hamid Siddiqui

/**
 * @author Hamid Siddiqui
 *         https://www.quora.com/profile/Hamid-Siddiqui
 *         https://github.com/inventionsbyhamid/
 *
 * @program To find sum of two numbers
 */
import java.io.*;
public class Sum {

    public static void main(String args[])throws IOException {

        BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));

        System.out.println("Enter first number");
        int num1 = Integer.parseInt(obj.readLine());

        System.out.println("Enter second number");
        int num2 = Integer.parseInt(obj.readLine());

        int sum = num1 + num2;//finding sum of two numbers
        System.out.println("Sum = " + sum);

    }
}
Sample Input/Output

Enter first number
234
Enter second number
567
Sum = 801




Area of Rectangle →

← Scanner Input