Java

Program to implement the product of two floating numbers.

Program to implement the product of two floating numbers.
import java.util.Scanner;

public class demo1 {

    public static void main(String[] args) {

        Scanner n = new Scanner(System.in);
        System.out.print("Enter first number: ");

        double num1 = n.nextDouble();
        
        System.out.print("Enter second number: ");
        double num2 = n.nextDouble();

        n.close();
        double product = num1*num2;
        
        System.out.println("Output: "+product);
    }
}
Nikhil Juneja

Passionate software developer and technical contributor at TutorialsLink.