Inputs
In previous examples we used fixed (hardcoded) values in programs.
But sometimes we need a value as an input from the user.
When a value gets read from the user, FlowRun stores it in a variable.
Let's write a program that reads a number from the user and outputs its value doubled:
- declare
x: Integer
- add an
Input
block, with variable namex
(x) - output
x * 2
For example, if the user enters 9
, output should be 18.