DocumentationInput and output
Input and output
Read values from the user and present results clearly with INPUT and PRINT.
On this page
Input brings values into a program. Output communicates the program's result.
Display output
PRINT accepts text, numbers, variables, and expressions.
MiniScript+
name = "Mara"score = 95PRINT "Student:"PRINT namePRINT score + 5Use short labels when a number would otherwise be ambiguous.
Read input
INPUT pauses the program, reads a value, and stores it in a variable.
MiniScript+
INPUT agePRINT ageThe variable becomes available to every instruction that follows.
Complete example
This program reads two values and prints their sum:
MiniScript+
PRINT "First number:"INPUT firstPRINT "Second number:"INPUT secondsum = first + secondPRINT "Sum:"PRINT sumInput checklist
- Give every input a meaningful variable name.
- Explain what value is expected before reading it.
- Validate ranges when only certain values are accepted.
- Keep the final output concise and unambiguous.
Testing
Run the same program with normal values, boundary values, and unexpected values. This makes assumptions visible before they become bugs.
Repeating input
Combine INPUT with a loop when several values must be processed.
MiniScript+
total = 0FOR index = 1 TO 3 INPUT value total = total + valueENDPRINT totalThe program reads exactly three values and prints their total.