Если используется Pascal.ABC, то строку massiv[i] := random(-19)+10; нужно заменить на massiv[i] := random(-10, 10);
const
countOfElements = 20;
var
i, countOfNumbers, randomNumber: integer;
massiv : array[1..countOfElements] of integer;
begin
Randomize;
countOfNumbers := 0;
for i:=1 to countOfElements do
begin
massiv[i] := random(-19)+10;
if ( (massiv[i] < 0) AND (massiv[i] > -5) ) then countOfNumbers += 1;
end;
writeln(countOfNumbers);
end.