Skip to content
EspañolWorkspace →

PSeInt NO operator (not): flip a condition

Flips a condition: true becomes false and false becomes true.

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

not-operator.psc · 3 lines
Algoritmo Example    Escribir NO (5 > 3)FinAlgoritmo

Output

Shows: FALSO (5 > 3 is true and NO flips it)

This is what the console shows when the example runs.

FALSO

Good to know

Instead of NO you can write ~ or !. The symbols work in every profile; the word NO works in profiles that allow word operators.

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.

NO encontradoSí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 "NO encontrado"; 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.

NO · 1 line
NO

Examples that use it

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

  • Guess the Number

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

    Intermediate
  • Insertion Sort

    Inserts each number among the sorted ones, like arranging cards in your hand.

    Intermediate
  • Linear vs. Binary Search

    Counts the comparisons each search needs on the same sorted list.

    Intermediate
  • Reusable Validation

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

    Intermediate
  • Shell Sort

    Insertion sort between far-apart elements, with a gap that shrinks every pass.

    Advanced
  • Heap Sort

    Arranges the array as a heap, then takes the largest out again and again.

    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.