Friday, 18 July 2014

How to Add Two Numbers in Java

Structure of Problem Requirements 

In this Simple Problem we just add two Number in Java . We Write this Code in Command Prompt and use very Simple way to get Better Understand of Java.

Source Code   

import java.util.Scanner;

public class Addition {

    public static void main(String[] args) {
    int a,b,c=0;
    Scanner s = new Scanner (;
    System.out.println("Enter Number ");
    a = s.nextInt();
    System.out.println("Enter Number ");
    b = s.nextInt();
    c = a+b;
    System.out.println (c);

Output of the Program

How to add two numbers in java
Adding two Numbers

Share it Please

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

2 comments: Post Yours! Read Comment Policy!▼
Important Note:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.

  1. why your categories link are not working ???????????????????????????????????????