0
Can you recommend some code/codes for this question? Thanks a lot đđ»
Write a Java program to print the sum (addition), multiply, subtract, divide and remainder of two numbers.
6 Answers
+ 1
It's too simple. Show us your code.
+ 1
bon Your code's working fine. So what help do you want?
0
import java.util.Scanner;
public class Javaexcercise {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input 1st number: ");
int num1 = in.nextInt();
System.out.print("Input 2nd number: ");
int num2 = in.nextInt();
System.out.println("Addition of two numbers: " + num1 + " + " + num2 + " = " +
(num1 + num2));
System.out.println("subtraction of two numbers: " +num1 + " - " + num2 + " = " +
(num1 - num2));
System.out.println("Multiplication of two numbers: "+ num1 + " x " + num2 + " = " +
(num1 * num2));
System.out.println("Division of two numbers: " + num1 + " / " + num2 + " = " +
(num1 / num2));
System.out.println("Remainder of two numbers: "+ num1 + " mod " + num2 + " = " +
(num1 % num2));
}
}
0
Sorry, I know itâs very simple to others but Iâm just a first year student
0
Do you prefer something likes this? đ
https://code.sololearn.com/c8a18A8A223A/?ref=app
0
thanks a lot for helping me pođđ»đ„ș