Java Program to Multiply two Floating Point Numbers
mrt481 439 28th Aug, 2022
Loading Please wait...
Description
In the above program, we have two floating-point numbers 1.5f and 2.0f stored in variables first and second respectively. Notice, we have used f after the numbers. This ensures the numbers are float, otherwise they will be assigned - type double. first and second are then multiplied using the * operator and the result is stored in a new float variable product. Finally, the result product is printed on the screen using println() function.
Recent Pastes
- C++ Program to Add Two Numbers
C++ | 5.6K | 11 months ago
- C++ Program to Print Number Entered by User
C++ | 3.3K | 11 months ago
- C++ "Hello, World!" Program
C++ | 2.4K | 11 months ago
Please disable your adblock and script blockers to view this page