In this example you will learn How to Multiply two Floating Point Numbers in Java.
Java Code: Write a program to How to Multiply two Floating Point Numbers in Java.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public static void main(String[] args) { // input from standard input - keyboard Scanner reader = new Scanner(System.in); System.out.print("Enter first number: "); float first =reader.nextFloat(); System.out.print("Enter first number: "); float second = reader.nextFloat(); float product = first * second; System.out.println("The product is: " + product); } |
Output:
In this example you have learned How to Multiply two Floating Point Numbers in Java.