Java Program to Multiply two Floating-Point Numbers
The float class is a wrapper class for the primitive type float which contains several methods to effectively deal with a float value like converting it to a string representation, and vice-versa. An object of the Float class can hold a single float value.
The task is to multiply two Floating point numbers in Java and print their multiplication.
- Initialize two float type numbers.
- Store their multiplication result in a float variable.
- Print that results
p = f1 * f2;
"The product is: "
The product is: 3.0
Time complexity: O(1) it is doing constant operations
Auxiliary Space: O(1)
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!