CJCoding With Joseph
15per day

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 cout with setprecision to display:

5 x 2.50 = 12.50

Use fixed and setprecision(2) for the float values. Remember to include <iomanip>. 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 (cout, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.