Skip to content
EspañolWorkspace →

PSeInt PI: the number π

The number π (pi), about 3.1416: how many times a circle's diameter fits around its edge.

Group:
Constants
Template
PI
Open it in Codoritmo

Opens the editor with this example loaded. Run it step by step and watch the flowchart.

Worked example

A complete algorithm, ready to copy and run.

pi-constant.psc · 5 lines
Algoritmo Example    radio <- 2    area <- PI * radio ^ 2    Escribir areaFinAlgoritmo

Output

With radio 2, area is 12.5663706144.

This is what the console shows when the example runs.

12.5663706144

In a flowchart

This is how it appears in a flowchart, with the same shapes Codoritmo draws.

area ← PI * r ^ 2
Used inside a calculation. It has no shape of its own; it's used inside a calculation. Flowchart: a process rectangle reading "area ← PI * r ^ 2", with one arrow in and one arrow out.
Draw the flowchart of your own algorithm →

Template

The general form. Replace what's inside < > with your own data.

PI · 1 line
PI

Examples that use it

Programs from the example library where it appears, from the simplest to the most complete.

  • Geometry

    Finds a circle's area and solves a right triangle.

    Intermediate
See every Math example →

More constants

Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.