How to make only even numbers from the entered ones appear on the screen as a result of the program in the array?

Consider an example of solving this problem in Pascal.

var
arr: array [0..50] of integer; // declare an array with dimension 50.
i, sum: integer; // declare variables of integer type.
begin
for i: = 1 to 50 do // start of the cycle.
begin
arr [i]: = random (1.50); // fill the array element with a random number from 1 to 50.
if (arr [i] mod 2 = 0) then // check the parity of the number.
write (arr [i], ”); // display the element of the array on the screen if it is an even number.
end;
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.