Java program to multiply given floating point numbers

Object Oriented ProgrammingJava8Java Programming

Example

Following is a program to multiply given floating point numbers.

import java.util.Scanner;
public class MultiplyFloatingNumbers {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter first floating point number.");
      float flt1 = sc.nextFloat();

      System.out.println("Enter second floating point number.");
      float flt2 = sc.nextFloat();

      float product = flt1*flt2;
      System.out.println("Product of given floating point numbers ::"+product);
   }
}

Output

Enter first floating point number.
2.2
Enter second floating point number.
6.3
Product of given floating point numbers ::13.860001
raja
Published on 26-Apr-2018 12:18:41
Advertisements