PSeInt Escribir: print messages and values
Shows a message or a value in the console; it's how your program talks to whoever uses it. Mix text in quotes and variables by separating them with commas.
- Group:
- Structures
- Template
Escribir
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 nombre <- "Ana" Escribir "Hola, ", nombreFinAlgoritmoOutput
Shows: Hola, Ana
This is what the console shows when the example runs.
Hola, AnaAnother example
Algoritmo Example Escribir "Total: ", 3 + 4FinAlgoritmoOutput
Shows: Total: 7
This is what the console shows when the example runs.
Total: 7Common mistake
Text goes inside quotes; variables go without them.
In 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.
Escribir <expresion>Examples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Hello World
Your first algorithm: print a couple of messages on screen.
BeginnerPersonal Greeting
Asks for your name and age, and answers with both.
BeginnerTemperature Converter
Converts degrees Celsius to Fahrenheit and Kelvin.
BeginnerTip Calculator
Splits a restaurant bill, tip included.
BeginnerCan 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.
Beginner
More structures
- Definir
- Dimension
- Escribir Sin Saltar
- Leer
- Assignment (<-)
- Si Entonces (if)
- Si / SiNo (if-else)
- Segun (switch)
- Mientras (while)
- Repetir Hasta Que (do-until)
- Repetir Mientras Que (do-while)
- Para (for)
- Para Cada (for each)
- Limpiar Pantalla
- Esperar
- Esperar Tecla
- SubProceso
- SubAlgoritmo
- Funcion (function)
- Retornar (return)
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.