Celsius to Fahrenheit

Easy10–15 pts depending on language · +25 for learning a language that's new to you

Convert a temperature from Celsius to Fahrenheit using the formula F = C × 9 / 5 + 32.

celsiusToFahrenheit(100) returns 212.0.

Watch your data types! In Java, C# and C++, 9 / 5 is integer division and gives 1, not 1.8. Write 9.0 / 5 so the math stays a decimal (a double).

Examples

Input: celsiusToFahrenheit(0)

Output: 32

Input: celsiusToFahrenheit(100)

Output: 212

Your solution is checked against 2 example tests and 5 hidden tests (edge cases and bigger inputs).

Solved by 6 members

  1. 1RainePython 3 · Oct 12
  2. 2Alex T.Rust · Oct 13
  3. 3brett B.Python 3 · Oct 14
  4. 4Isaac M.Python 3 · Oct 14
  5. 5CasonRust · Oct 20
Full leaderboard →

Your Solution

Languages you don't learn in class are worth more: C++ 1.25×, JavaScript, TypeScript, C, Rust and Go 1.5×. Your first solve in a language unlocks its "Learned" achievement: +25 for learning it.

Loading editor...

IntelliSense: connecting…

Run Code checks the example tests. Submit runs every test, including hidden ones.