An array of natural numbers is given. Fill in with a random number generator.

An array of natural numbers is given. Fill in with a random number generator. Count the number of even numbers from 1 to 10.

const R = 20; // size of the original array
Var a: array [1..R] of integer;
i, sum: integer;
begin
// fill the array with random numbers from 0 to 100
For i: = 1 to R do a [i]: = random (100);
// print the resulting array
writeln (‘Original array’);
For i: = 1 to R do write (a [i], ”);
Writeln ();
// count the number of even numbers from 1 to 10
sum: = 0; // zero the amount
For i: = 1 to R do
begin
if (a [i] mod 2 = 0) {if the number is even} and ((a [i]> = 1) or (a [i] <= 10)) {and in a given interval} then
sum: = sum + 1; // increase the counter by 1
end;
// display the amount
Writeln (‘The number of even numbers from 1 to 10:’, sum);
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.