Tuesday, August 11, 2020

Write a Program to Multiply Two Numbers in Java.

Multiply Two Numbers in Java.


Multiply Two Numbers in Java.

Multiplication two number in java,first program takes any two number entered user.
The second program takes any two numbers (can be integer or floating point) and displays the result.

EXAMPLE :-

import java.util.Scanner;

public class Mul {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);
System.out.print("Enter First Number :: ");

int number1 = scan.nextInt();
System.out.print("Enter Second Number :: ");
int number2 = scan.nextInt();

scan.close();
int product = number1*number2;
System.out.println("Output is :: "+product);
}
}


OUTPUT

Enter First Number :: 25
Enter Second Number :: 42 Output is :: 1050

No comments:

Post a Comment

Please do not any spam link in Comment Box