Online Go Compiler

package main import ( "fmt" "math" ) type Circle struct { radius float64 } func (r *Circle)Area() float64{ return math.Pi * r.radius * r.radius } func (r *Circle)Perimeter() float64{ return 2 * math.Pi * r.radius } func main(){ var radius float64 fmt.Printf("Enter radius of the circle: ") fmt.Scanf("%f", &radius) c := Circle{radius: radius} fmt.Printf("Area of the circle is: %.2f\n", c.Area()) fmt.Printf("Perimeter of the circle is: %.2f\n", c.Perimeter()) }