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

By | 19.01.2017

Java Program to find Sum of two numbers by input value from keyboard


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

 

3.5 4 votes
Article Rating
Category: Basic Programs Java Programming Tags:

About Tunde A

My name is Tunde Ajetomobi, a Tech Enthusiast and Growth Hacker. I enjoy creating helpful content that solves problem across different topics. Codezclub is my way of helping young aspiring programmers and students to hone their skills and find solutions on fundamental programming languages.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments