Write a Program to do Addition of two numbers in Java


Addition of two numbers in Java





import java.util.Scanner;
class Add
{
public static void main(String args[])
 {
   int a,b,c;
 Scanner S= new Scanner(System.in);
 System.out.println("Enter two number");
 a=S.nextInt();
 b=S.nextInt();
c=a+b;
System.out.println("Addition is"+c);
}

}

Output:

Comments