Write a program that generates an array of 16 random integers from -20 to 20 and counts the number

Write a program that generates an array of 16 random integers from -20 to 20 and counts the number of negative elements.

const
n = 16;

var
a: array [1..n] of integer;
i, k: longint;

begin
k: = 0;
write (‘The elements of this array are:’);
randomize;
for i: = 1 to n do
begin
a [i]: = random (40) – 20;
write (a [i], ”);
if a [i] <0 then k: = k + 1;
end;
writeln;
writeln (‘Total negative array elements:’, k, ‘.’);
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.