Write a Java Program to add 2 numbers.

Solution :- 

import java.util.*;
class add
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.println(“Enter the first number :- “);
int a = in.nextInt();
System.out.println(“Enter the Second number :- “);
int b = in.nextInt();
int add = a+b;
System.out.println(“The Sum of 2 number is :- “+add);
}
}

Output :-

Try it