Skip to content
EspañolWorkspace →

PSeInt Repetir Mientras Que (do-while loop)

Repeats and keeps going while the condition is true; it stops when it turns false. The opposite of Hasta Que.

Template
Mientras Que
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.

repetir-mientras-que-do-while.psc · 5 lines
Algoritmo Example    Repetir        Leer n    Mientras Que n < 0FinAlgoritmo

Output

Keeps asking while the number is negative.

This is what the console shows when the example runs. What the user types is highlighted.

User answer: -5User answer: -1User answer: 4

In a flowchart

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

…n < 0SíNo
In the flowchart. Flowchart: the body first, then a decision diamond with the condition "n < 0" below it; on Sí (yes) it repeats, on No it leaves.
Draw the flowchart of your own algorithm →

Template

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

Mientras Que · 3 lines
Repetir  <acciones>Mientras Que <condicion>

Examples that use it

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

  • Modular Menu

    A unit converter with a menu that keeps coming back.

    Intermediate
See every Repetir example →

More structures

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.