Beginner

Convert Celsius to Fahrenheit

Description

In this challenge, you'll write a function that converts a given temperature in Celsius to Fahrenheit.

This exercise will help you understand function parameters, arithmetic operations, and return values.

The formula to convert Celsius to Fahrenheit is: Fahrenheit = ( Celsius × 9 5 ) + 32 Fahrenheit=(Celsius× 5 9 ​ )+32

The function should:

  • Take a single number as input, representing the temperature in Celsius. Return the equivalent temperature in Fahrenheit.
  • Handle both positive and negative temperatures. Assume the input is always a valid number (no need to check for non-numeric values).

Example usage:

console.log(convertCelsiusToFahrenheit(0));
// Expected output: 32
console.log(convertCelsiusToFahrenheit(25));
// Expected output: 77
console.log(convertCelsiusToFahrenheit(-10));
// Expected output: 14

window code 2Test Cases

Input:

0

Expected Output:

32