Monday, 18 August 2014

Addition of Two Number

package com.tutorial4u;

import java.util.Scanner;

public class Addition {
     public static void main(String[] args) {
           int a, b, c;
           Scanner sc = new Scanner(System.in);
           System.out.print("Ener value of a : ");
           a = sc.nextInt();
           System.out.print("Enter value of b : ");
           b = sc.nextInt();
           c = a + b;
           System.out.println("Added Value of a and b is : " + c);
     }

}


Output :

Ener value of a : 13
Enter value of b : 34
Added Value of a and b is : 47

No comments:

Post a Comment

Java Development Kit (JDK) and Java Runtime Environment (JRE)

                  Java Development Kit (JDK) and Java Runtime Environment (JRE)  To download and install the Java Development Kit (  JDK ) ...