In a one-dimensional array of n numbers, display positive elements on the screen and report their number.

Program:

const X = 100;

var
a: array [1..X] of integer;
n, S, i: integer;
begin
writeln (‘Enter the number of array elements:’);
read (n);
writeln (‘Enter array elements:’);
for i: = 1 to n do
read (a [i]);
write (‘Positive elements of the array:’);
for i: = 1 to n do
if a [i]> 0 then
begin
S: = S + 1;
write (a [i], ”);
end;
writeln;
writeln (‘The given array contains’, S, ‘positive elements’);
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.