Computer Science, asked by shristydwivedy90, 7 months ago

WAP to enter a numbers and the sum, difference, product and Quotient.
Write using INPUT statement..✍️​

Answers

Answered by khushdeep5595
2

Answer:

import java.util.Scanner;

public class number{

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.print("Input first number: ");

int num1 = in.nextInt();

System.out.print("Input second number: ");

int num2 = in.nextInt();

System.out.println(num1 + " + " + num2 + " = " +

(num1 + num2));

System.out.println(num1 + " - " + num2 + " = " +

(num1 - num2));

System.out.println(num1 + " x " + num2 + " = " +

(num1 * num2));

System.out.println(num1 + " / " + num2 + " = " +

(num1 / num2));

System.out.println(num1 + " mod " + num2 + " = " +

(num1 % num2));

}

Similar questions