# You are given a two-dimensional array of 5 rows and 4 columns, formulated in a random way.

**You are given a two-dimensional array of 5 rows and 4 columns, formulated in a random way. Find the sum of positive elements of 1 row and the number of negative elements of 3 columns.**

program zz1;

const n = 5;

m = 4; // set the number of elements in the array

var i, j, k: integer; // set variables of integer type

b: array [1..n, 1..m] of integer;

begin

for i: = 1 to n do

for j: = 1 to m do // get numbers and write them into an array

b [i, j]: = random (101) -50;

for i: = 1 to n do // display the resulting array on the screen

begin

for j: = 1 to m do

write (b [i, j]: 4);

writeln;

end;

for j: = 1 to m do

if b [1, j]> 0 then k: = k + b [1, j];

writeln (‘the sum of positive elements of 1 line =’, k); // display the answer

k: = 0;

for i: = 1 to n do

if b [i, 3] <0 then k: = k + 1;

write (‘number of negative elements 3 columns =’, k); // display the answer

end.