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
^
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.
Algoritmo Example Escribir 2 ^ 10FinAlgoritmoOutput
Shows: 1024 (2 multiplied by itself 10 times)
This is what the console shows when the example runs.
1024In a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
^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.
IntermediateFactorial and Power
Functions that compute a factorial and a power.
IntermediateQuadratic Equation
Solves ax² + bx + c = 0, with real or complex roots.
IntermediateGeometry
Finds a circle's area and solves a right triangle.
IntermediateTowers of Hanoi
Solves the classic tower puzzle step by step.
Advanced
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.