Skip to content
EspañolWorkspace →

PSeInt O operator (or): when one condition is enough

Joins two conditions and is true when at least one is. Think "this or that will do".

Group:
Logical
Template
O
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.

or-operator.psc · 3 lines
Algoritmo Example    Escribir (5 > 3) O (2 > 8)FinAlgoritmo

Output

Shows: VERDADERO (the first one being true is enough)

This is what the console shows when the example runs.

VERDADERO

Good to know

Instead of O you can write ||. The symbol works in every profile; the word O works in profiles that allow word operators, like the default one.

Some details depend on your school's profile. See the language profiles.

In a flowchart

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

dia = "sab" O dia = "dom"Sí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 "dia = "sab" O dia = "dom""; 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.

O · 1 line
O

Examples that use it

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

  • GCD and LCM

    Computes the greatest common divisor and the least common multiple.

    Intermediate
  • Roman Numerals

    Converts a number from 1 to 3999 into Roman numerals.

    Advanced
  • ATM

    Checks your PIN and lets you check, deposit and withdraw money.

    Advanced
See every Logic example →

More logical

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.