About 8,060,000 results
Open links in new tab
  1. Java: Print the sum of two numbers - w3resource

    May 12, 2025 · Write a program that takes two floating-point numbers as input and prints their sum rounded to 2 decimal places. Modify the program to add two numbers but handle integer …

  2. Java How To Add Two Numbers - W3Schools

    Learn how to add two numbers with user input: x = myObj.nextInt(); // Read user input System.out.println("Type another number:"); . y = myObj.nextInt(); // Read user input . sum = x …

  3. Java Program to Add Two Numbers - GeeksforGeeks

    Dec 25, 2023 · Sum of N Numbers in Java can be done using the Steps mentioned below: Print the Sum calculated. Below is the implementation of the above method: Output: These are the …

  4. Java Program to Add Two Integers

    In this program, two integers 10 and 20 are stored in integer variables first and second respectively. Then, first and second are added using the + operator, and its result is stored in …

  5. Sum of Numbers in Java - Tpoint Tech

    There are two ways to find the sum of two numbers in Java. The Java Scanner class allows us to read input from the user. We take two numbers as input and pass them to the user-defined …

  6. Java Program Addition Of Two Numbers – 4 Ways | Programs - Java

    Apr 16, 2025 · Java program to print or calculate addition of two numbers with sample outputs and example programs.

  7. Java Program To Add Two Numbers (Scanner) For Freshers

    Nov 12, 2019 · This program shows how to find the sum of two numbers in a java programming language. This is a very basic when we learn any language first. So, We will see how to do …

  8. Java Program to Add two Numbers - BeginnersBook

    Jul 25, 2022 · In this tutorial, you will learn how to write a Java program to add two numbers. We will see three programs: In the first program, the values of the two numbers are given. In the …

  9. Java program to sum of two numbers - Codeforcoding

    Sep 13, 2024 · Sum of two numbers using the Scanner class. In this program, the user asked to enter two integer values. these two integers are stored in variables num_1 and num_2 …

  10. Java Program to Add Two Numbers - BTech Geeks

    Jul 24, 2024 · To add two numbers in a java program, we will first take two integers as input from user using Scanner and store them in a integer variable num1 and num2. Then we add num1 …