Skip to content
EspañolWorkspace →

Not equal in PSeInt: the <> and != operators

Asks whether two values are different. True when they aren't equal. Can also be written <>.

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.

not-equal-operator.psc · 3 lines
Algoritmo Example    Escribir 3 <> 4FinAlgoritmo

Output

Shows: VERDADERO

This is what the console shows when the example runs.

VERDADERO

Good to know

<> and != mean the same thing; use the one your class uses.

In a flowchart

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

respuesta <> 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 "respuesta <> 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.

  • Sum Until Zero

    Adds up the numbers you type until you enter a 0.

    Beginner
  • Name Initials

    Gets the initials of a full name.

    Beginner
  • Selection Sort

    Finds the smallest of the remaining numbers and puts it in its place.

    Intermediate
  • Palindromes

    Checks whether a phrase reads the same forwards and backwards.

    Intermediate
  • Modular Menu

    A unit converter with a menu that keeps coming back.

    Intermediate
  • GCD and LCM

    Computes the greatest common divisor and the least common multiple.

    Intermediate
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.