Java Program to Multiply two Floating Point Numbers - safetxt
avatar
Java Program to Multiply two Floating Point Numbers

mrt481 435 28th Aug, 2022

Java 0.27 KB
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

Please disable your adblock and script blockers to view this page