← Back to Printing
Question 10
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 printf to display the output shown in Expected Output. Use%dfor the integer, and%.2ffor 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= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Printing
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.