How to Add Two Numbers in Java

This is simple java program for beginners to add two Number in 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.in);
    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

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.

1 comments:

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

    ReplyDelete