Another exercise on golang, experience in python helps me pick up golang rather quickly.
calculate the area of a circle.
package main import ( "fmt" "math" ) func area(radius float64) float64 { return math.Pi * radius * radius } func main(){ var r float64 fmt.Println("Enter radius: ") fmt.Scanf("%f", &r) a := area(r) fmt.Printf("The radius is %f and the area is %f.", r, a) }