โ Back to Printing
Question 23
Product with Float
Product with Float
Create an int variable with the value 5 and a float variable with the value 2.5f. Multiply them together and use System.out.printf() to display: 5 x 2.50 = 12.50 Use %d for the integer, and %.2f for both float values (the original float and the result). The result of multiplying an int and a float is a float.
Expected Output:
5 x 2.50 = 12.50
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.