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

Haskell program of Celsius to Kelvin added #5596

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
celsiusToKelvin :: Float -> Float
celsiusToKelvin celsius = celsius + 273.15

main :: IO ()
main = do
putStrLn "Enter temperature in Celsius:"
input <- getLine
let celsius = read input :: Float
kelvin = celsiusToKelvin celsius
putStrLn $ "Temperature in Kelvin: " ++ show kelvin