diff --git a/Add.java b/Add.java new file mode 100644 index 0000000..a27e885 --- /dev/null +++ b/Add.java @@ -0,0 +1,20 @@ + class Add{ + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.print("Enter the first number: "); + int num1 = scanner.nextInt(); + + System.out.print("Enter the second number: "); + int num2 = scanner.nextInt(); + + int sum = num1 + num2; + System.out.println("The sum of " + num1 + " and " + num2 + " is: " + sum); + + scanner.close(); + } +} +output: +Enter the first number:2 +Enter the secomg number:3 +The sum of 2 and 3 is:5