Java Program to Multiply two Floating Point Numbers
mrt481 435 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.4K | 10 months ago
- C++ Program to Print Number Entered by User
C++ | 3.2K | 10 months ago
- C++ "Hello, World!" Program
C++ | 2.3K | 10 months ago
Please disable your adblock and script blockers to view this page