viewing paste Unknown #9631 | Java

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import java.util.Scanner;
 
public class Sandbox 
{
 
    public static void main (String[] args)
    {
        int num1=0, num2=0, sum=0;
        Scanner input = new Scanner(System.in);
        
        System.out.println("Let's add two numbers! Please enter the first number: ");
        num1 = input.nextInt();
        
        System.out.println("Please enter the next number: ");
        num2 = input.nextInt();
        
        sum = num1 + num2;
        
        System.out.println("The sum of those two numbers are: " + sum);
        
        input.close();
    }
}
Viewed 960 times, submitted by Guest.