# Java Programming: Adding Two Numbers with Ease

#### Example

```plaintext
Input 
enter the first number 5
enter the second number 6
Output
The sum is 11
```

#### Required to know

Use of **Variables**, Use of different operators like **assignment or arithmetic operators**, Use of functions like **System.out.print(), and** Use of **Data types.**

#### Steps

1. Take two numbers as input from the user.
    
2. Use the arithmetic operator `addition (+)`, to perform the sum of two numbers.
    
3. Print the result.
    

#### Program

```java
import java.util.Scanner;

public class sum {

    /**
     * This class adds two numbers and prints the result.
     */

    public static void main(String[] args) {

        // Create a Scanner object to read user input.
        Scanner sc = new Scanner(System.in);

        // Prompt the user to enter two numbers.
        System.out.print("Enter the first number: ");
        int a = sc.nextInt();
        System.out.print("Enter the second number: ");
        int b = sc.nextInt();

        // Calculate the sum of the two numbers.
        int c = a + b;

        // Print the result.
        System.out.println("The sum is " + c);
    }
}
```
