Q:

Java Program to implement the product of two floating numbers

0

Java Program to implement the product of two floating numbers by getting user input.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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);
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now