Convert Celsius to Fahrenheit using javascript

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

console.log(convertToF(30)); // 86 
console.log(convertToF(90)); // 194
console.log(convertToF(-30)); // -22
console.log(convertToF(0)); // 32
console.log(convertToF(20)); // 68
console.log(convertToF(30)); // 86

Leave a Comment

Your email address will not be published. Required fields are marked *