Skip to content
EspañolWorkspace →

Powers in PSeInt: the ^ operator

Raises a number to a power: multiplies it by itself as many times as the exponent says.

Group:
Algebraic
Template
^
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.

power-operator.psc · 3 lines
Algoritmo Example    Escribir 2 ^ 10FinAlgoritmo

Output

Shows: 1024 (2 multiplied by itself 10 times)

This is what the console shows when the example runs.

1024

In a flowchart

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

area ← lado ^ 2
Used inside a calculation. It has no shape of its own; it's used inside a calculation. Flowchart: a process rectangle reading "area ← lado ^ 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.

^ · 1 line
^

Examples that use it

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

  • Body Mass Index

    Computes your BMI and classifies it as underweight, normal and so on.

    Intermediate
  • Factorial and Power

    Functions that compute a factorial and a power.

    Intermediate
  • Quadratic Equation

    Solves ax² + bx + c = 0, with real or complex roots.

    Intermediate
  • Geometry

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

    Intermediate
  • Towers of Hanoi

    Solves the classic tower puzzle step by step.

    Advanced
See every Math example →

More algebraic

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.