Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Typescript Celsius to Kelvin Program added (#5573)
Browse files Browse the repository at this point in the history
* Typescript Celsius to Kelvin Program added

* Rename convert_celsius_to_kelvin.ts to ConvertTemperatureFromCelsiusToKelvin.ts

---------

Co-authored-by: Riyazul555 <riyazulislam2003@gmail.com>
Co-authored-by: Harsh Raj <harshraj8843@gmail.com>
  • Loading branch information
3 people authored Mar 28, 2024
1 parent 6fa1578 commit 8e49f94
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function celsiusToKelvin(celsius: number): number {
const kelvin: number = celsius + 273.15;
return kelvin;
}

const celsiusTemperature: number = -40;
const kelvinTemperature: number = celsiusToKelvin(celsiusTemperature);
console.log(`${celsiusTemperature} degrees Celsius is equal to ${kelvinTemperature} Kelvin.`);

0 comments on commit 8e49f94

Please sign in to comment.