+ 1

Java

Please write a program that asks for two numbers and then displays the amount on the screen (Java)

9th Aug 2019, 7:21 AM
Михаил Попов
Михаил Попов - avatar
1 Réponse
+ 1
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner (System.in); System.out.print("Input the first number: "); int num1 = input.nextInt(); System.out.print("Input the second number: "); int num2 = input.nextInt(); int sum = num1 + num2; System.out.println(); System.out.println("Sum: "+sum); } }
18th Oct 2019, 5:02 PM
RamonR
RamonR - avatar