Q:

Write a Java Program to find Addition of two numbers by input value from keyboard

belongs to collection: Java Basic Solved Programs

0

Write a Java Program to find Addition of two numbers by input value from keyboard

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

SOURCE CODE: :

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 ::

Enter any two numbers : 
4
2
Sum: 6

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Java Basic Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a Java Program to Swap two numbers without u... >>
<< Write a Java program to Swap two numbers using thi...