Please let me know what programs are used to make the code and also a description of how to do this please!
Write a Java program to print the sum (addition), multiplication, subtraction, and division of two numbers.
Start your code by copying/pasting this information into an editor like notepad, notepad++, or IDLE:
public class Main {
public static void main(String[] args) {
// Write your code here
}
}
Sample input:
Input first number: 125
Input second number: 24
Sample Output:
125 + 24 = 149
125 - 24 = 101
125 x 24 = 3000
125 / 24 = 5
import java.util.Scanner; public class Main { public static void main(String [] args) { Scanner kb = new Scanner(System.in); System.out.print("Input first number: "); int x = kb.nextInt(); System.out.print("Input second number: "); int y = kb.nextInt(); System.out.println(x+" + "+y+" = "+(x+y)); System.out.println(x+" - "+y+" = "+(x-y)); System.out.println(x+" x "+y+" = "+(x*y)); System.out.println(x+" / "+y+" = "+(x/y)); } }
Get Answers For Free
Most questions answered within 1 hours.