Files
headfirstgo/chapter4/tocelsius/tocelsius.go
2025-01-30 19:32:45 +03:00

18 lines
311 B
Go

package main
import (
"fmt"
"headfirstgo/headfirstgo/chapter4/keyboard"
"log"
)
func main() {
fmt.Print("Enter a temperature in Farenheit: ")
farenheit, err := keyboard.GetFloat()
if err != nil {
log.Fatal(err)
}
celsius := (farenheit - 32) * 5 / 9
fmt.Printf("%0.2f degrees Celsius\n", celsius)
}