In this example you will learn how to Java Program To Multiply Two Floating Point Numbers.
Java Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // Create a Scanner object System.out.print("Enter Floating Number 1:"); float first = scanner.nextFloat(); System.out.print("Enter Floating Number 2:"); float second = scanner.nextFloat(); float product = first * second; System.out.println("The product is: " + product); } |
Output: