Calculate Sum in Java

Calculate Sum in Java

Calculate Sum in Java

Codes:

import java.util.Scanner;

public class sumExample{

	public static void main(String[] args) {
		
		Scanner input = new Scanner(System.in);
		
		System.out.println("What is the first number?");
		int a = input.nextInt();
		
		System.out.println("What is the second number?");
		int b = input.nextInt();
		
		int sum = a+b;
		System.out.println(a+"+"+b+"="+sum);

	}

}

Output Screen:

java sum two numbers