# Find the product of the elements of the array A (12), which are divisible by 4. The elements of the array

June 26, 2021 | education

| **Find the product of the elements of the array A (12), which are divisible by 4. The elements of the array are random numbers issued by the function instead of the readln operator use M [i]: = random (100).**

Uses crt;

var a: array [1..12] of integer;

p, i: integer;

begin

p: = 1;

for i: = 1 to 12 do

begin

a [i]: = random (100);

write (a [i], ”);

if (a [i] <> 0) and (a [i] mod 4 = 0) then p: = p * a [i];

end;

writeln;

write (p);

end.

SECOND OPTION FOR PERFORMANCE OF THE PROCEDURE?

program massiv4;

uses crt;

var a: array [1..12] of integer;

begin

clrscr;

randomize;

repeat

a [i]: = random (100);

write (a [i], ”);

if (a [i] <> 0) and (a [i] mod 4 = 0) then p: = p * a [i];

end;

writeln;

write (p);

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.