Javascript program to convert celsius to fahrenheit

Configurare noua (How To)

Situatie

You can convert the celsius value to fahrenheit by using the formula:

fahrenheit = celsius * 1.8 + 32

Solutie

Pasi de urmat

// program to convert celsius to fahrenheit
// ask the celsius value to the user
const celsius = prompt(“Enter a celsius value: “);

// calculate fahrenheit
const fahrenheit = (celsius * 1.8) + 32

// display the result
console.log(`${celsius} degree celsius is equal to ${fahrenheit} degree fahrenheit.`);

Output

Enter a celsius value: 55
55 degree celsius is equal to 131 degree fahrenheit.

Tip solutie

Permanent

Voteaza

(3 din 8 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?