package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) fmt.Print("Height in metres (e.g. 1.78): ") text, _ := reader.ReadString('\n') height, _ := strconv.ParseFloat(strings.TrimSpace(text), 64) fmt.Print("Weight in kg (e.g. 72.5): ") text, _ = reader.ReadString('\n') weight, _ := strconv.ParseFloat(strings.TrimSpace(text), 64) bmi := weight / (height * height) fmt.Printf("BMI: %.1f\n", bmi) }