JAVA PROGRAM

/* Java Program Example */

Add two  numbers and print on the screen.

import java.util.Scanner;

class add
{
public static void main(String []args)
{

int a,b,c;
Scanner sa=new Scanner(System.in);

System.out.print(“Enter first number=”);
a=sa.nextInt();
System.out.print(“Enter second number=”);
b=sa.nextInt();

c=a+b;

System.out.print(“Sum of two numbers are=”+c);
}
}

 

When the above program is  compile and executed , it will produce the following output :

Enter first  number=2

Enter second number=3

Sum of two numbers are = 5