Einfach 0 gelöst 0% Erfolgsquote

Celsius to Fahrenheit

Convert a temperature from Celsius to Fahrenheit.

Problem

Convert a temperature in degrees Celsius to degrees Fahrenheit using F = C × 9 / 5 + 32.

Implement celsius_to_fahrenheit(celsius).

Input

celsius: The temperature in degrees Celsius.

Output

Return the temperature in degrees Fahrenheit (a decimal number).

Einschränkungen

-273.15 ≤ celsius ≤ 10,000

Beispiele

Beispiel 1
Eingabe:
celsius = 100.0

Erwartete Ausgabe:
expected = 212.0
Eingabe:
double celsius = 100.0;

Erwartete Ausgabe:
double expected = 212.0;
Eingabe:
double celsius = 100.0;

Erwartete Ausgabe:
double expected = 212.0;

Erläuterung

100 × 9 / 5 + 32 = 212, the boiling point of water.

Beispiel 2
Eingabe:
celsius = -40.0

Erwartete Ausgabe:
expected = -40.0
Eingabe:
double celsius = -40.0;

Erwartete Ausgabe:
double expected = -40.0;
Eingabe:
double celsius = -40.0;

Erwartete Ausgabe:
double expected = -40.0;

Erläuterung

-40 × 9 / 5 + 32 = -40: both scales meet at -40.

Referenzen

Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.

Von anderen lernen

Community-Lösungen

Noch keine veröffentlichten Lösungen. Löse die Aufgabe und teile als Erster eine Lösung.