develop a java program to accept two numbers from user and display product of two numbers when user press multiply button.
Answers
Answered by
1
Develop a java program to accept two numbers from user and display product of two numbers when user press multiply button.
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 number1 = in.nextInt();
System.out.print("Input 2nd number: ");
int number2 = in.nextInt();
System.out.println("Product of two numbers: "+ number1 + " x " + number2 + " = " + number1 * number2);
}
}
Similar questions