yt

Header Ads

Write a Program Addition of Two Numbers in Java- Technology369kk

 Addition of Two Numbers in Java:-  

Program:  


import java.util.*;
class Add{
    public static void main(String args[]){
        System.out.println("Enter 1st Number:");
        Scanner in = new Scanner(System.in);
        int num1 = in.nextInt();

        System.out.println("Enter 2nd Number:");
        int  num2 = in.nextInt();

        int sum=  num1+num2;
        System.out.print("Two Number sum is :"+ sum);


    }
}



Output:  


PS D:\Learning File\BCA\BCA 3rd Sem\JAVA OOP\AllPraQue> java Add
Enter 1st Number:
5
Enter 2nd Number:
6
Two Number sum is :11




Note:  How to Run this code we are already explained  by our Java Complete Course, where step by step guide installation to Run 1st Program in Java pls read>

Java Complete Course 


 



No comments

Theme images by Dizzo. Powered by Blogger.