Java Program to multiply two decimal number ( floating number ) by taking input from user


This program will multiply two floating or a decimal number, taken from user input. Hence, it will give the final product of two numbers.

Program
import java.util.*; public class MultiplyNumbers { public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("Enter two float number"); float a = s.nextFloat(); float b = s.nextFloat(); float product = a * b; System.out.println("The product is: " + product); } }
Input
Output