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).
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).
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...
Run Code checks the example tests. Submit runs every test, including hidden ones.