Review

Using all the previous concepts to convert the temprature in kelvin to celsius > fahrenheit > newton.

Example:


// storing the kelvin value
let kelvin = 293;

  

// Converting Celsius to Kelvin format
let celsius = kelvin - 273;

  

// Converting Celsius format to Fahrenheit
let fahrenheit = celsius * (9/5) + 32;

  

// Rounding off fahrenheit value
fahrenheit = Math.floor(fahrenheit);

  
// Printing down the final temprature in fahrenheit
console.log(`The temprature is ${fahrenheit} degree fahrenheit.`);

  

// Converting celsius to newton format
let newton = celsius * (33 / 100);

  

// Rounding off the newton value
newton = Math.floor(newton);

  

// Printing down the final temprature in newton
console.log(`The temprature in newton is ${newton} newton.`);

Last updated