← Back to Printing
Question 14
Temperature Conversion
Temperature Conversion
Create a float variable for Fahrenheit temperature with the value 98.6f. Convert it to Celsius using the formula: celsius = (fahrenheit - 32) * 5 / 9. Use printf to display the output shown in Expected Output.
Both temperatures should be displayed with exactly 1 decimal place using %.1f. The conversion formula will give you 37.0 degrees Celsius.Expected Output:
98.6°F = 37.0°C= newline. No newline after the last line.
Hints3 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.