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