HTMLify
ET Go Input Output
Views: 16 | Author: guest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | package main import ( "fmt" "strconv" ) func main() { fmt.Print("Please enter a number: ") var input string fmt.Scanln(&input) number, err := strconv.ParseFloat(input, 64) if err != nil { fmt.Println("That is not a valid number.") } else { fmt.Printf("You entered the number: %f\n", number) } } |