# You are given an array A [1..18, 1 .. n] and a natural number n. Create a program for finding

August 18, 2021 | education

| **You are given an array A [1..18, 1 .. n] and a natural number n. Create a program for finding the largest modulo element of the array, as well as the index of this element.**

program arrays_19;

const n = 5; // set n

var i, j, x1, x2, k: integer;

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

begin

for i: = 1 to 18 do begin

for j: = 1 to n do begin

m [i, j]: = random (101) -50; // fill the matrix with random numbers and display it

write (m [i, j]: 5);

end;

writeln;

end;

k: = – 100000; // set the initial value for the maximum

for i: = 1 to 18 do begin

for j: = 1 to n do begin

if abs (m [i, j])> k then begin k: = m [i, j]; x1: = i; x2: = j; end;

end;

end;

write (‘the maximum element modulo =’, k, ‘its indices’, x1, ”, x2); // output the response

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.