Enter statement
In order for the user to be able to set the value of the variable himself, it is necessary to be able to enter values from the keyboard.
The input operator is written like this:
After this statement, the data that is entered from the keyboard is stored in a certain variable.
You can also combine several
read()
statements into one.
For example, the entry
read(a);
read(b);
performs the same actions as writing
read(a, b);
that is, the first entered data is entered into the variable a
, the second into the variable b
.