write a program to print the sum, product and difference of two number 9 and 12
Answers
Answered by
2
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Input the first number: ");
int n1 = scanner.nextInt();
System.out.println("Input the second number: ");
int n2 = scanner.nextInt();
int sum = n1 + n2;
int minus = n1 - n2;
int multiply = n1 * n2;
int subtract = n1 + n2;
int divide = n1 / n2;
int rnums = n1 % n2;
System.out.printf("Sum = %d\nMinus = %d\nMultiply = %d\nSubtract = %d\nDivide = %d\nRemainderOf2Numbers = %d\n ", sum, minus, multiply, subtract, divide, rnums);
}
}
---------------------------------------------------------- MARK AS BRAINLIEST
Similar questions
Geography,
5 months ago
Geography,
5 months ago
Environmental Sciences,
5 months ago
Computer Science,
10 months ago
World Languages,
10 months ago
Math,
1 year ago
English,
1 year ago