Skip to content
EspañolWorkspace →

Less than in PSeInt: the < operator

Asks whether the left value is less than the right one. The open side of the sign faces the bigger number.

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.

less-than-operator.psc · 3 lines
Algoritmo Example    Escribir 3 < 8FinAlgoritmo

Output

Shows: VERDADERO

This is what the console shows when the example runs.

VERDADERO

In a flowchart

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

temperatura < 0SíNo
Used inside a condition. It has no shape of its own; it's used inside a condition. Flowchart: a decision diamond with the condition "temperatura < 0"; the Sí (yes) exit continues down and the No exit turns right.
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
  • Guess the Number

    Guess a secret number from 1 to 100 in seven tries.

    Intermediate
  • Bubble Sort

    Sorts random numbers by swapping neighbors, and stops as soon as they're in order.

    Intermediate
  • Reusable Validation

    Validates the email and age on a sign-up form.

    Intermediate
  • Merge Sort

    Splits the array in halves, sorts each one recursively and merges them.

    Advanced
  • Quicksort

    Picks a pivot, splits smaller from larger values and sorts each side recursively.

    Advanced
See every Si example →

More relational

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.