1.6K
Program to take two number as input, printing their sum as output.
public class AddTwoIntegers {
public static void main(String[] args) {
int first = 10;
int second = 20;
System.out.println("Enter two numbers: " + first + " " + second);
int sum = first + second;
System.out.println("The sum is: " + sum);
}
}
What You get as Output , After running the program
Enter two numbers: 10 20
The sum is: 30