Java Program to find Sum of two numbers by input value from keyboard
SOURCE CODE: :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import java.util.Scanner; class Addition { public static void main(String[] args) { int a, b, c=0; Scanner s=new Scanner(System.in); System.out.println("Enter any two numbers :"); a=s.nextInt(); b=s.nextInt(); c=a+b; System.out.println("Sum: "+c); } } |
OUTPUT ::
1 2 3 4 |
Enter any two numbers : 4 2 Sum: 6 |