Write an algorithm for guessing numbers in the range from 1 to 8.
January 27, 2021 | education
| program zz1;
label 1; // describe the label for the transition
var a, b: integer; // set variables of integer type
begin
b: = random (8) + 1; // get a random number in the range from one to eight
1: write (‘enter a number from 1 to 8’); // enter a number from the keyboard in the range from one to eight
read (a);
if (a <> b) // check the condition, if the entered number is not equal to random, then
then begin writeln (‘guessed wrong’); goto 1; end // display the answer and go to the label
else write (‘guessed’); // print another answer
end.
One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.