Skip to content

Circle area

Go method with receiver

Same task in: C++PHP

Flowchart (ISO 5807)

StartReturn 3.14159·c.r·c.rEndFigure 1 — Circle.Area

Source code

Go
func (c Circle) Area() float64 {
    return 3.14159 * c.r * c.r
}

The editor opens with this code — change it and the chart redraws.

Language
Go
Constructs
method with receiver
Topic
Classes & methods
Formats
Word, Visio, draw.io, PDF, SVG

Related examples