Write a Javascript Program to Convert Celsius to Fahrenheit

In JavaScript, you can easily convert Celsius to Fahrenheit by using a simple mathematical formula.

The formula for converting Celsius to Fahrenheit is:

Fahrenheit = Celsius * (9/5) + 32

Here’s how you can implement this formula in JavaScript to create a program that converts Celsius to Fahrenheit:

function convertCelsiusToFahrenheit(celsius) {
  const fahrenheit = celsius * (9/5) + 32;
  return fahrenheit;
}

const celsius = 30;
const fahrenheit = convertCelsiusToFahrenheit(celsius);

console.log(`${celsius}°C is equal to ${fahrenheit}°F`);

In this program, we have created a function called convertCelsiusToFahrenheit that takes a temperature value in Celsius as a parameter and returns the equivalent temperature value in Fahrenheit.

We have then called this function with a Celsius temperature of 30 and stored the returned Fahrenheit value in a variable called fahrenheit.

Finally, we have used console.log to print out the original Celsius value and its equivalent Fahrenheit value.

You can use this program to convert any Celsius temperature to its equivalent Fahrenheit value.

Simply call the convertCelsiusToFahrenheit function with the Celsius temperature value that you want to convert, and the function will return the equivalent Fahrenheit value.