PSeInt Si SiNo (if-else): a decision with two paths
A decision with two paths: one for when the condition is true and another (SiNo) for when it's false. Exactly one of the two always runs.
- Group:
- Structures
- Template
SiNo
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.
Algoritmo Example nota <- 75 Si nota >= 60 Entonces Escribir "Pass" SiNo Escribir "Fail" FinSiFinAlgoritmoOutput
With nota 75 it shows "Pass"; with 40, "Fail".
This is what the console shows when the example runs.
PassIn a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
Si <condicion> Entonces <acciones>Sino <acciones>FinSiExamples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Can I Vote?
Tells you whether you can vote or how many years you have left.
BeginnerCoffee Shop Menu
Pick a drink from the menu and get the total to pay.
BeginnerSum Until Zero
Adds up the numbers you type until you enter a 0.
BeginnerBody Mass Index
Computes your BMI and classifies it as underweight, normal and so on.
IntermediateParking Fee
Charges every started hour, with a daily maximum.
IntermediateLeap Year
Applies the calendar rules to tell whether a year is a leap year.
Intermediate
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.