Temperature Converter - Problem
Create a program that converts temperatures between Celsius and Fahrenheit scales.
Given a temperature in Celsius, calculate and display both:
- The equivalent temperature in Fahrenheit
- The original temperature in Celsius for verification
Use the formula: Fahrenheit = (Celsius × 9/5) + 32
Input: A floating-point number representing temperature in Celsius
Output: Two floating-point numbers - first the Fahrenheit equivalent, then the original Celsius value
Input & Output
Example 1 — Room Temperature
$
Input:
celsius = 25.0
›
Output:
77.0 25.0
💡 Note:
Room temperature 25°C converts to 77°F using F = (25 × 9/5) + 32 = 77
Example 2 — Freezing Point
$
Input:
celsius = 0.0
›
Output:
32.0 0.0
💡 Note:
Water freezing point 0°C converts to 32°F using F = (0 × 9/5) + 32 = 32
Example 3 — Negative Temperature
$
Input:
celsius = -10.0
›
Output:
14.0 -10.0
💡 Note:
Cold temperature -10°C converts to 14°F using F = (-10 × 9/5) + 32 = 14
Constraints
- -273.15 ≤ celsius ≤ 1000.0
- Temperature must be above absolute zero
Visualization
Tap to expand
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code