Skip to content

Circle area

C++ class method

Same task in: PHPGo

Flowchart (ISO 5807)

StartReturn 3.14159rrEndFigure 1 — Circle::area

Source code

C++
class Circle {
public:
    double r;
    double area() {
        return 3.14159 * r * r;
    }
};

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

Language
C++
Constructs
class method
Topic
Classes & methods
Formats
Word, Visio, draw.io, PDF, SVG

Related examples